Groovy Documentation

gpars.scheduler
Class Scheduler

java.lang.Object
  gpars.scheduler.Scheduler
All Implemented Interfaces:
Pool

class Scheduler

Prototype of self-regulated thread pooled scheduler

Self regulation happened according to following rules - worker thread, which had nothing to do 10 seconds dies - if no tasks were taken for processing during last 0.5sec new worker starts


Nested Class Summary
class Scheduler.WatchdogThread

class Scheduler.WorkerThread

 
Field Summary
static RuntimeException TERMINATE

long lastTaskPoke

long schedulerTime

boolean terminating

AtomicInteger threadCount

 
Constructor Summary
Scheduler()

Scheduler(int coreSize)

 
Method Summary
void execute(Runnable task)

Runnable loop(Runnable operation)

void resetDefaultSize()

void resize(int poolSize)

void shutdown()

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

TERMINATE

static final RuntimeException TERMINATE


lastTaskPoke

long lastTaskPoke


schedulerTime

long schedulerTime


terminating

boolean terminating


threadCount

AtomicInteger threadCount


 
Constructor Detail

Scheduler

public Scheduler()


Scheduler

public Scheduler(int coreSize)


 
Method Detail

execute

public void execute(Runnable task)


loop

public Runnable loop(Runnable operation)


resetDefaultSize

public void resetDefaultSize()


resize

public void resize(int poolSize)


shutdown

@SuppressWarnings({"ObjectAllocationInLoop"})
public void shutdown()


 

Groovy Documentation