开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜