[jboss-jira] [JBoss JIRA] Closed: (JBCOMMON-15) In BasicThreadPool allow the queue passed to MinPooledExecutor to be configurable.

Adrian Brock (JIRA) jira-events at lists.jboss.org
Mon Mar 26 12:08:49 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBCOMMON-15?page=all ]

Adrian Brock closed JBCOMMON-15.
--------------------------------

    Resolution: Rejected
      Assignee:     (was: Dimitris Andreadis)

The JBoss ThreadPool uses a modified version of the Executor to avoid this problem.

The original problem is not a deadlock, it is a race condition in the oswego pooled
executor where it doesn't refill the pool.

See org.jboss.util.threadpool.MinPooledExecutor for a more detailed explaination
of the race condition.

To even see the problem (in the original code), you need the scheduling thread to be inactive
for the "idle timeout' time (e.g. long garbage collection).
You also then need nobody else to try to handoff work to the thread pool such
that new threads are never constructed.

The MinPooledExecutor *always* keeps at least one idle thread around
which avoids the race condition.

> In BasicThreadPool allow the queue passed to MinPooledExecutor to be configurable.
> ----------------------------------------------------------------------------------
>
>                 Key: JBCOMMON-15
>                 URL: http://jira.jboss.com/jira/browse/JBCOMMON-15
>             Project: JBoss Common
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 1.0.4.GA
>            Reporter: Ron Sigal
>
> According to http://altair.cs.oswego.edu/pipermail/concurrency-interest/2004-September/001037.html, "in certain circumstances the combination of PooledExecutor with BoundedLinkedQueue with a waitWhenBlocked policy can lead to deadlock." 
> A post in the Remoting forum, http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995334#3995334, indicates that a deadlock has been detected in Remoting due to its use of BasicThreadPool.  In response, the blocking policy in Remoting has been changed from WAIT to RUN, though WAIT would be preferable.  The poster in  http://altair.cs.oswego.edu/pipermail/concurrency-interest/2004-September/001037.html indicates that an alternative solution is to use BoundedBuffer in place of BoundedLinkedQueue.
> It would be useful, therefore, if a queue could be passed to the BasicThreadPool constructor.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list