[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
Thu Nov 6 10:20:46 EST 2008


"adrian at jboss.org" wrote : The fix/work around we have is to stop step (8) from occuring.i.e. you never allow the thread pool to go below a minimum of one thread which avoids the race condition - there is always at least one thread available to execute the work.

Ah, I understand.  I intuited that this might be the case so I made the core thread pool size be implicitly at least 1, but I agree that this is undesirable overall.  It would be nice if thread pools which are never used would never produce any threads.  For my "blocking" policy, I'm not actually using a special rejection handler; instead I wrap the BlockingQueue with one that blocks on "offer".  I still have to do some testing to see if that's a good approach, however I suspect it will not suffice to avoid this race condition even if it is a usable approach overall.

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

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



More information about the jboss-dev-forums mailing list