1. Springboot project. There is a
new Thread (new Runnable () {
//
})
means that the front end will open a thread for business logic processing for each request interface. This is because the business processing in the thread is very time-consuming (basically about half an hour). Because the experience is not allowed to be stuck consistently, the thread is opened for business processing, and the interface returns an ID. The front end can view it by identifying the percentage of thread execution in the business in another interface, and the execution phase in the thread business logic is updated in the database. Empty another interface for query.
2. The business in the thread does not have a statement similar to
while (true) {}
, because it takes time to execute the business and queries processed in the business, and the execution completion thread ends.
3, the current problem is that if the front-end concurrent requests (30 times), and then there will be no response in the request interface, restart normally
4, I generally know that the memory in the thread should not be released, but I do not know how to optimize
5, the main question is how to handle this kind of time-consuming requests relatively well; let the thread memory processing should be how to handle and release.