groovyx.gpars.scheduler
Class ResizeableFJPool

java.lang.Object
  extended by groovyx.gpars.scheduler.FJPool
      extended by 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

Field Summary
private  java.lang.Object lock
           
private static int MAX_POOL_SIZE
           
 
Fields inherited from class groovyx.gpars.scheduler.FJPool
pool
 
Fields inherited from interface groovyx.gpars.scheduler.Pool
POOL_SIZE_MUST_BE_A_POSITIVE_NUMBER, UNCAUGHT_EXCEPTION_OCCURRED_IN_ACTOR_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 groovyx.gpars.scheduler.FJPool
getConfiguredPoolSize, getForkJoinPool, getPoolSize, resetDefaultSize, resize, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_POOL_SIZE

private static final int MAX_POOL_SIZE
See Also:
Constant Field Values

lock

private final java.lang.Object lock
Constructor Detail

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
Method Detail

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

Copyright © 2008–2010 Václav Pech. All Rights Reserved.