groovyx.gpars.scheduler
Class ResizeableFJPool
java.lang.Object
groovyx.gpars.scheduler.FJPool
groovyx.gpars.scheduler.ResizeableFJPool
- All Implemented Interfaces:
- Pool
public final class ResizeableFJPool
- extends FJPool
Represents the actors' thread pool, which performs tasks on behalf of the actors. Uses a ForkJoinPool from JSR-166y
The actors' thread pool size defaults to the n + 1, where n is the number of processors/cores available on the machine.
The VM parameter -Dgpars.poolsize can be used the configure the default size of the actors' thread pool.
The resize() and resetDefaultSize() methods can be used to configure size of the thread pool at runtime.
- Author:
- Vaclav Pech
Date: Feb 27, 2009
Fields inherited from class groovyx.gpars.scheduler.FJPool |
pool |
Constructor Summary |
ResizeableFJPool()
Creates the pool with default number of threads. |
ResizeableFJPool(int poolSize)
Creates the pool with specified number of threads. |
Method Summary |
void |
execute(java.lang.Runnable task)
schedules a new task for processing with the pool |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_POOL_SIZE
private static final int MAX_POOL_SIZE
- See Also:
- Constant Field Values
lock
private final java.lang.Object lock
ResizeableFJPool
public ResizeableFJPool()
- Creates the pool with default number of threads.
ResizeableFJPool
public ResizeableFJPool(int poolSize)
- Creates the pool with specified number of threads.
- Parameters:
poolSize
- The required size of the pool
execute
public void execute(java.lang.Runnable task)
- schedules a new task for processing with the pool
- Specified by:
execute
in interface Pool
- Overrides:
execute
in class FJPool
- Parameters:
task
- The task to schedule