C# Class Disruptor.PhasedBackoffWaitStrategy

Phased wait strategy for waiting EventProcessor s on a barrier.

This strategy can be used when throughput and low-latency are not as important as CPU resource. Spins, then yields, then blocks on the configured BlockingStrategy.

Inheritance: IWaitStrategy
ファイルを表示 Open project: disruptor-net/Disruptor-net

Public Methods

Method Description
PhasedBackoffWaitStrategy ( System.TimeSpan spinTimeout, System.TimeSpan yieldTimeout, IWaitStrategy fallbackStrategy ) : System
SignalAllWhenBlocking ( ) : void

IWaitStrategy.SignalAllWhenBlocking

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

IWaitStrategy.WaitFor

WithLock ( System.TimeSpan spinTimeout, System.TimeSpan yieldTimeout ) : PhasedBackoffWaitStrategy

Block with wait/notifyAll semantics

WithSleep ( System.TimeSpan spinTimeout, System.TimeSpan yieldTimeout ) : PhasedBackoffWaitStrategy

Block by sleeping in a loop

Private Methods

Method Description
GetSystemTimePreciseAsFileTime ( long &filetime ) : void
GetSystemTimeTicks ( ) : long
PhasedBackoffWaitStrategy ( ) : System

Method Details

PhasedBackoffWaitStrategy() public method

public PhasedBackoffWaitStrategy ( System.TimeSpan spinTimeout, System.TimeSpan yieldTimeout, IWaitStrategy fallbackStrategy ) : System
spinTimeout System.TimeSpan
yieldTimeout System.TimeSpan
fallbackStrategy IWaitStrategy
return System

SignalAllWhenBlocking() public method

IWaitStrategy.SignalAllWhenBlocking
public SignalAllWhenBlocking ( ) : void
return void

WaitFor() public method

IWaitStrategy.WaitFor
public WaitFor ( long sequence, Sequence cursor, ISequence dependentSequence, ISequenceBarrier barrier ) : long
sequence long
cursor Sequence
dependentSequence ISequence
barrier ISequenceBarrier
return long

WithLock() public static method

Block with wait/notifyAll semantics
public static WithLock ( System.TimeSpan spinTimeout, System.TimeSpan yieldTimeout ) : PhasedBackoffWaitStrategy
spinTimeout System.TimeSpan
yieldTimeout System.TimeSpan
return PhasedBackoffWaitStrategy

WithSleep() public static method

Block by sleeping in a loop
public static WithSleep ( System.TimeSpan spinTimeout, System.TimeSpan yieldTimeout ) : PhasedBackoffWaitStrategy
spinTimeout System.TimeSpan
yieldTimeout System.TimeSpan
return PhasedBackoffWaitStrategy