geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <da...@coredevelopers.net>
Subject Thread pool strategy
Date Thu, 08 Jul 2004 22:24:10 GMT
I've been working with the thread pools and PooledExecutor from 
concurrent a bit lately and understand how they work a little better 
than I used to:-)

I've changed the ThreadPool implementation to:

have a hard max size limit (and minSize == maxSize)
have a Queue that all waiting tasks are put on.
No task is ever executed in the calling thread.

I think this is the most appropriate policy for all thread pools in 
geronimo.  I'd be interested in other opinions... I don't consider 
myself an expert in this.

I'm not sure if the current implementation ever gets smaller, since the 
minsize == maxsize.  Having maxSize > minSize would involve writing a 
LinkedQueue subclass that can communicate with the PooledExecutor to 
determine if the pool size < maxSize.  I'm reluctant to introduce this 
complication without evidence that it is needed.

Many thanks
david jencks


Mime
View raw message