You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Hes Siemelink <he...@izecom.com> on 2004/08/03 11:00:33 UTC
RE: Migration ... change for Thread Pool
> -----Original Message-----
> From: Noel J. Bergman [mailto:noel@devtech.com]
> Sent: donderdag 29 juli 2004 18:44
> To: James Developers List
> Subject: RE: Migration ... change for Thread Pool
>
> > 1) Is it an option to use the Apache Commons Thread Pool?
> > It is stable, widely used and highly configurable.
>
> Someone would have to write a block for it.
Do you think that would be a good idea?
> > I would like to be able to configure my thread pool so it
> > blocks (with a time-out) until a new thread is available,
> > so more mail will be accepted when the load is high.
>
> Not everyone wants the same thing, which is why you can replace the
> thread manager. However, take a look at the ResourceLimitingThread
> classes in http://svn.apache.org/repos/asf/avalon/cvs-migration-
snapshot/avalon-components/cornerstone/threads/impl/src/java/org/apache/avalon/cornerstone/blocks/threads/. The configuration options should be flexible enough to
> support both.
Whoa – that *is* hidden! You know, even for a trained user that is quite buried!
Does this mean I can add the following line to my config file?
<thread-manager>
<thread-group>
<name>default</name>
<priority>5</priority>
<is-daemon>false</is-daemon>
<max-threads>20</max-threads>
<min-threads>20</min-threads>
<min-spare-threads>10</min-spare-threads>
<!-- Tell thread manager to wait for 5 seconds for a thread to become available --> <block-timeout>5000<block-timeout>
</thread-group>
</thread-manager>
To make life easier, I think it would be a good idea to document this in the config file.
And why not make include all Avalon (Excalibur, Cornerstoner, etc) sources in a james-with-all--sources release?
> If someone wants to write a ThreadManager that uses Jakarta Commons
> instead of the Excalibur classes, go for it. You can use the
> ResourceLimitingThread code and our org.apache.james.util.thread
> package as examples. Our package is a self-contained implementation of
> everything necessary, importing only interfaces from Avalon.
I would suggest standardizing on one thread package – on the one that is most stable, documented, widely used and supported. I don’t know which one of the currently available implementations that would be. If you were to start from scratch, I think I would choose the Apache Commons library, but that is mostly because I haven’t been able to find clear documentation on the use of the others.
Cheers,
Hes.