|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.queue.WorkerPoolFactory
public class WorkerPoolFactory
Creates named, queued, daemon Thread pools.
The requirements are:
SynchronousQueue
based ThreadPoolExecutor
satisfies 1 and 2, but not 3.
A bounded or unbound queue based ThreadPoolExecutor
allows for 3, but will tend to create
up to the maximum number of threads and makes no guarantee on thread scheduling.
SynchronousQueue
backed ThreadPoolExecutor
.
SynchronousQueue
is not guaranteed behavior. also there's a race condition between previously retiring threads and new work -
prior to being returned to the shared pool we can create extra threads if the shared pool is exhausted.
TODO: bounded queuing - we never bothered bounding in the past with our worker pools, but reasonable
defaults would be a good idea.
Constructor Summary | |
---|---|
WorkerPoolFactory()
|
Method Summary | |
---|---|
static WorkerPool |
newWorkerPool(java.lang.String name,
int numThreads)
Creates a WorkerPool that prefers thread reuse over thread creation based upon the given parameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkerPoolFactory()
Method Detail |
---|
public static WorkerPool newWorkerPool(java.lang.String name, int numThreads)
name
- numThreads
- the maximum number of worker threads allowed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |