public class FJPool extends java.lang.Object
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.
Modifiers | Name | Description |
---|---|---|
private static long |
DEFAULT_SHUTDOWN_TIMEOUT |
|
private int |
configuredPoolSize |
|
protected java.util.concurrent.ForkJoinPool |
pool |
Type | Name and description |
---|---|
private static java.util.concurrent.ForkJoinPool |
createPool(int poolSize) Creates a fork/join pool of given size. |
void |
execute(java.lang.Runnable task) schedules a new task for processing with the pool |
protected int |
getConfiguredPoolSize() |
java.util.concurrent.ForkJoinPool |
getForkJoinPool() Retrieves the internal executor service. |
int |
getPoolSize() Retrieves the current thread pool size |
void |
resetDefaultSize() Sets the pool size to the default |
void |
resize(int poolSize) Resizes the thread pool to the specified value |
void |
shutdown() Gently stops the pool |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Creates the pool with default number of threads.
Creates the pool with specified number of threads.
configuredPoolSize
- The required size of the poolCreates the pool wrapping the provided ForkJoinPool
pool
- The ForkJoinPool instance to wrapCreates a fork/join pool of given size. Each thread will have the uncaught exception handler set to print the unhandled exception to standard error output.
poolSize
- The required pool sizeschedules a new task for processing with the pool
task
- The task to scheduleRetrieves the internal executor service.
Retrieves the current thread pool size
Sets the pool size to the default
Resizes the thread pool to the specified value
poolSize
- The new pool sizeGently stops the pool
Copyright © 2008–2014 Václav Pech. All Rights Reserved.