简体   繁体   中英

No Task in ThreadPoolExecutor , will the ThreadPoolexecutor die?

I have created the static object for ThreadPoolExecutor class and in my web application I'm adding tasks to ThreadPoolExecutor for every request.

My question is after all the requests are processed and what happen to ThreadPoolExecutor class(in my case I have created the static object for thread poolexecutor) whether It becomes shut down the service or still waiting for new tasks to submit?

If you don't shut it down with executor.shutdown() it'll stay running of course, waiting for tasks that may never come.

I'm sure this is described in the Javadocs for the class, but for some reason reading the Javadocs seems to be uncool these days.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM