org.codehaus.gpars

groovyx.gpars.scheduler
Class ResizeableFJPool

java.lang.Object
  groovyx.gpars.scheduler.FJPool
      groovyx.gpars.scheduler.ResizeableFJPool

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.

Authors:
Vaclav Pech Date: Feb 27, 2009


Field Summary
private static int MAX_POOL_SIZE

private java.lang.Object lock

 
Fields inherited from class 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 FJPool
execute, getConfiguredPoolSize, getForkJoinPool, getPoolSize, resetDefaultSize, resize, shutdown
 

Field Detail

MAX_POOL_SIZE

private static final int MAX_POOL_SIZE


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

@Override
public void execute(java.lang.Runnable task)
schedules a new task for processing with the pool
Parameters:
task - The task to schedule


 

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