| java.lang.Object java.lang.Thread org.jsmtpd.generic.threadpool.GrowingThreadPool
GrowingThreadPool | public class GrowingThreadPool extends Thread implements ThreadPool(Code) | | This needs testing.
A growable thread pool.
It's like the generic thread pool, but :
Starts at 10% of initial threads provided (or whatever you set with growthRatio)
When the pool is exhausted and a new thread is required, it will start
numThreads*growRatio new threads, and place them in the pool, if the pool
has still lower than numThreads
Each 5000 ms, (or whatever you set), a "control thread" will look for
unused threads and decrease the size of the pool as needed. There must have been no
creation since 4* cycleTime.
author: Jean-Francois POUX See Also: org.jsmtpd.generic.threadpool.IThreadedClass |
countFreeThread | public synchronized int countFreeThread()(Code) | | |
forceShutdown | public synchronized void forceShutdown()(Code) | | Will force each thread to shutdown
|
gracefullShutdown | public synchronized void gracefullShutdown()(Code) | | Will gracefully shutdown each running thread
|
growPool | public synchronized void growPool()(Code) | | |
hasFreeThread | public synchronized boolean hasFreeThread()(Code) | | true if any free thread |
lowerPool | public synchronized void lowerPool()(Code) | | |
setCycleTime | public void setCycleTime(int cycleTime)(Code) | | Time in ms of wait time of control thread
|
setGrowthRatio | public void setGrowthRatio(float growthRatio)(Code) | | Ratio between 0.1 and 0.9 of grow rate of the pool
|
setMinRatio | public void setMinRatio(float minRatio)(Code) | | Minimal ratio of pool (between 0.1 and 1)
|
|
|