| java.lang.Object org.jsmtpd.generic.threadpool.GenericThreadPool
GenericThreadPool | public class GenericThreadPool implements ThreadPool(Code) | | A generic, fixed-size thread pooler
each not busy thread are kept waiting
Things to do to add auto-grow ability :
Record number of active th over time (at each assign free th, or a controling thread)
if thread pool is inactive during a while, and curent size is bigger than min size,
try to remove free thds from the pool. => synchronize the collection
Add a max thread int
add min thread int
Instead of throwing an exception directly when pool is exhausted
try to increase by 10% the number of thd, if under max th., then re assign a thread.
author: Jean-Francois POUX See Also: org.jsmtpd.generic.threadpool.IThreadedClass |
countFreeThread | public synchronized int countFreeThread()(Code) | | |
forceShutdown | public void forceShutdown()(Code) | | Will force each thread to shutdown
|
gracefullShutdown | public void gracefullShutdown()(Code) | | Will gracefully shutdown each running thread
|
hasFreeThread | public synchronized boolean hasFreeThread()(Code) | | true if any free thread |
|
|