slump wrote:
> I think I found a race condition in 
> OrderedThreadPoolExecutor/UnorderedThreadPoolExecutor
> <snip/>
> And in OrderedThreadPoolExecutor  , have the same race condition.
>   
I don't think there is a race condition. At worst, you will have a task
waiting for a thread in the queue, until another task finish. This is a
best effort system, where you create a new thread if there is none
remaining, which does not mean each incoming task will be affected to
this new thread.
> And I have one more question: 
> Why not just use  ThreadPoolExecutor in JDK instead of  
> UnorderedThreadPoolExecutor? 
> does UnorderedThreadPoolExecutor have some special requirement which  
> ThreadPoolExecutor can't fulfil?
>   
The class javadoc is pretty clear about the diffeence between the
UnorderedThreadPoolExecutor and the JDK ThreadPollExecutor class. And
you can verify that the MINA class extends the ThreadPollExecutor class.
It just add extra semantic.

Hope it helps.
>   


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to