[concurrency-interest] ThreadPoolExecutor's allowCoreThreadTimeOut

David Holmes dcholmes at optusnet.com.au
Sun Aug 26 17:50:24 EDT 2007


How you were actually constructing the ThreadPoolExecutor?

David Holmes
  -----Original Message-----
  From: concurrency-interest-bounces at cs.oswego.edu
[mailto:concurrency-interest-bounces at cs.oswego.edu]On Behalf Of Moran
  Sent: Sunday, 26 August 2007 7:27 PM
  To: concurrency-interest at cs.oswego.edu
  Subject: [concurrency-interest] ThreadPoolExecutor's

  I have noticed some strange behavior using the ThreadPoolExecutor when
moving to java 1.6 (1.6.0_02-b06 on windows xp)

  Core pool threads were being terminated although I was explicitly setting
the core pool size:

  ThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long
keepAliveTime,  TimeUnit unit,

                                BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory)

  I noticed it when JConsole was up and monitoring the thread consumption.
After my 1 min timeout, all threads were terminated.

In 1.6, the new allowCoreThreadTimeOut(boolean value) will in fact explain
this behavior if value is set to true - But I am not explicitly calling it,
but instead using the constructor above.

I should not that on a linux running 1.6.0-rc-b104 it seemed to have behaved
as expected.Is anyone aware of such a fix or a known issue?  Thanks in



-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070827/1bf5ea7a/attachment.html 

More information about the Concurrency-interest mailing list