|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgpars.scheduler.Scheduler
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 startsNested 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 |
---|
static final RuntimeException TERMINATE
long lastTaskPoke
long schedulerTime
boolean terminating
AtomicInteger threadCount
Constructor Detail |
---|
public Scheduler()
public Scheduler(int coreSize)
Method Detail |
---|
public void execute(Runnable task)
public Runnable loop(Runnable operation)
public void resetDefaultSize()
public void resize(int poolSize)
@SuppressWarnings({"ObjectAllocationInLoop"}) public void shutdown()
Groovy Documentation