|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Balancer
The Balancer controls the maximum of concurrent threads in the current Scheduler(s) and prevents from own thread resources exhaustion if other group of schedulers share the same pool of threads.
If a permit is available,acquirePermit() simply returns and a new test is scheduled
by Scheduler.schedule(Runnable) in the current runner. Otherwise waiting for a release.
One permit is released as soon as the child thread has finished.
| Method Summary | |
|---|---|
boolean |
acquirePermit()
Acquires a permit from this balancer, blocking until one is available. |
void |
releaseAllPermits()
|
void |
releasePermit()
Releases a permit, returning it to the balancer. |
| Method Detail |
|---|
boolean acquirePermit()
true if current thread is NOT interrupted
while waiting for a permit.void releasePermit()
void releaseAllPermits()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||