| java.lang.Object org.cougaar.util.ReusableThreadPool
ReusableThreadPool | public class ReusableThreadPool (Code) | | Provide a pool of reusable threads to reduce the overhead of
construction/destruction of large numbers of standard thread,
particularly on VM implementation which use OS-level thread
implementations.
The general contract is that wherever you might have used
"new Thread()", you use "ReusableThread.newThread()" instead.
Most of the Thread constructors are provided as factory methods -
missing are all constructors using ThreadGroup arguments.
|
Inner Class :public static class Counter | |
ReusableThreadPool | public ReusableThreadPool(ThreadGroup group, int initial, int maximum)(Code) | | |
ReusableThreadPool | public ReusableThreadPool(int initial, int maximum)(Code) | | |
constructReusableThread | protected ReusableThread constructReusableThread()(Code) | | actually construct a new ReusableThread *
|
getAllocatedThreads | public int getAllocatedThreads()(Code) | | Return the total number of threads created. This can be larger than
the maximum pool size because the pool is usually
allowed to create additional threads which will not be reclaimed.
|
getMaximumSize | public int getMaximumSize()(Code) | | |
reclaimReusableThread | void reclaimReusableThread(ReusableThread t)(Code) | | return a reusableThread to our pool. package protected
so we don't get the wrong thread in our pool.
|
|
|