|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lmax.disruptor.BusySpinWaitStrategy
public final class BusySpinWaitStrategy
Busy Spin strategy that uses a busy spin loop for EventProcessors waiting on a barrier.
This strategy will use CPU resource to avoid syscalls which can introduce latency jitter. It is best
used when threads can be bound to specific CPU cores.
| Constructor Summary | |
|---|---|
BusySpinWaitStrategy()
|
|
| Method Summary | |
|---|---|
void |
signalAllWhenBlocking()
Signal those EventProcessors waiting that the cursor has advanced. |
long |
waitFor(long sequence,
Sequence cursor,
Sequence[] dependents,
SequenceBarrier barrier)
Wait for the given sequence to be available |
long |
waitFor(long sequence,
Sequence cursor,
Sequence[] dependents,
SequenceBarrier barrier,
long timeout,
java.util.concurrent.TimeUnit sourceUnit)
Wait for the given sequence to be available with a timeout specified. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BusySpinWaitStrategy()
| Method Detail |
|---|
public long waitFor(long sequence,
Sequence cursor,
Sequence[] dependents,
SequenceBarrier barrier)
throws AlertException,
java.lang.InterruptedException
WaitStrategy
waitFor in interface WaitStrategysequence - to be waited on.cursor - on which to wait.dependents - further back the chain that must advance firstbarrier - the processor is waiting on.
AlertException - if the status of the Disruptor has changed.
java.lang.InterruptedException - if the thread is interrupted.
public long waitFor(long sequence,
Sequence cursor,
Sequence[] dependents,
SequenceBarrier barrier,
long timeout,
java.util.concurrent.TimeUnit sourceUnit)
throws AlertException,
java.lang.InterruptedException
WaitStrategy
waitFor in interface WaitStrategysequence - to be waited on.cursor - on which to wait.dependents - further back the chain that must advance firstbarrier - the processor is waiting on.timeout - value to abort after.sourceUnit - of the timeout value.
AlertException - if the status of the Disruptor has changed.
java.lang.InterruptedException - if the thread is interrupted.public void signalAllWhenBlocking()
WaitStrategyEventProcessors waiting that the cursor has advanced.
signalAllWhenBlocking in interface WaitStrategy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||