public final class BusySpinIdleStrategy extends java.lang.Object implements IdleStrategy
| Constructor and Description |
|---|
BusySpinIdleStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
idle()
Perform current idle action (e.g.
|
void |
idle(int workCount)
Note: this implementation will result in no safepoint poll once inlined.
|
void |
reset()
Reset the internal state in preparation for entering an idle state again.
|
java.lang.String |
toString() |
public void idle(int workCount)
idle in interface IdleStrategyworkCount - performed in last duty cycle.IdleStrategy.idle(int)public void idle()
IdleStrategyIdleStrategy.reset() to clear internal state when idle period is over (or before it begins).
Callers are expected to follow this pattern:
while (isRunning)
{
if (!hasWork())
{
idleStrategy.reset();
while (!hasWork())
{
if (!isRunning)
{
return;
}
idleStrategy.idle();
}
}
doWork();
}
idle in interface IdleStrategypublic void reset()
IdleStrategyreset in interface IdleStrategypublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014-2019 Real Logic Ltd. All Rights Reserved.