How to apply timeout to core threads within ThreadPoolExecutor in Java5
My question is as straight and simple as the title illustrates, put it another way, what is the equivalent method in jdk 1.5 of the allowCoreThreadTimeOut in jdk1.6? Because I do need all idle core threads released afte开发者_Python百科r, say 30s, if no more new tasks come in betwwen, thanks for any helpful pointers!
If you need the 1.6 functionality in 1.5, then you can use the backport-util-concurrent library which retrofits newer concurrency stuff into older Java versions as a 3rd-party library.
Specifically, you can get the 1.6 functionality in your 1.5 app.
精彩评论