[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Declaration and deployment of threads and thread pools i

david.lloyd@jboss.com do-not-reply at jboss.com
Tue Dec 16 17:53:25 EST 2008


One observation about using a corePoolSize of 0.  The most obvious reason you'd do this is to prevent a thread pool from having threads hanging around when there are no tasks.  However, if you have a non-zero-length queue, then no threads will be started until the queue is full.  This means that if the queue is never filled, the tasks will never run.

I think that for this use case, the proper solution, introduced as of JDK6 into ThreadPoolExecutor, is to use a non-zero corePoolSize and enable core thread timeouts.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4196995#4196995

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4196995



More information about the jboss-dev-forums mailing list