C# Class Disruptor.YieldingWaitStrategy

Yielding strategy that uses a Thread.yield() for EventProcessor s waiting on a barrier after an initially spinning. This strategy is a good compromise between performance and CPU resource without incurring significant latency spikes.
Inheritance: IWaitStrategy
ファイルを表示 Open project: disruptor-net/Disruptor-net

Public Methods

Method Description
SignalAllWhenBlocking ( ) : void

Signal those IEventProcessor waiting that the cursor has advanced.

WaitFor ( long sequence, Sequence cursor, ISequence dependentSequence, ISequenceBarrier barrier ) : long

Wait for the given sequence to be available

This strategy is a good compromise between performance and CPU resource without incurring significant latency spikes.

Private Methods

Method Description
ApplyWaitMethod ( ISequenceBarrier barrier, int counter ) : int

Method Details

SignalAllWhenBlocking() public method

Signal those IEventProcessor waiting that the cursor has advanced.
public SignalAllWhenBlocking ( ) : void
return void

WaitFor() public method

Wait for the given sequence to be available

This strategy is a good compromise between performance and CPU resource without incurring significant latency spikes.

public WaitFor ( long sequence, Sequence cursor, ISequence dependentSequence, ISequenceBarrier barrier ) : long
sequence long sequence to be waited on.
cursor Sequence Ring buffer cursor on which to wait.
dependentSequence ISequence dependents further back the chain that must advance first
barrier ISequenceBarrier barrier the is waiting on.
return long