C# 클래스 Disruptor.Sequence

Cache line padded sequence counter. Can be used across threads without worrying about false sharing if a located adjacent to another counter in memory.
파일 보기 프로젝트 열기: disruptor-net/Disruptor-net 1 사용 예제들

공개 메소드들

메소드 설명
AddAndGet ( long value ) : long

Increments the sequence and stores the result, as an atomic operation.

CompareAndSet ( long expectedSequence, long nextSequence ) : bool

Atomically set the value to the given updated value if the current value == the expected value.

IncrementAndGet ( ) : long

Increments the sequence and stores the result, as an atomic operation.

Sequence ( long initialValue = InitialCursorValue ) : System.Runtime.InteropServices

Construct a new sequence counter that can be tracked across threads.

SetValue ( long value ) : void

Perform an ordered write of this sequence. The intent is a Store/Store barrier between this write and any previous store.

SetValueVolatile ( long value ) : void

Performs a volatile write of this sequence. The intent is a Store/Store barrier between this write and any previous write and a Store/Load barrier between this write and any subsequent volatile read.

ToString ( ) : string

Value of the Sequence as a String.

메소드 상세

AddAndGet() 공개 메소드

Increments the sequence and stores the result, as an atomic operation.
public AddAndGet ( long value ) : long
value long
리턴 long

CompareAndSet() 공개 메소드

Atomically set the value to the given updated value if the current value == the expected value.
public CompareAndSet ( long expectedSequence, long nextSequence ) : bool
expectedSequence long the expected value for the sequence
nextSequence long the new value for the sequence
리턴 bool

IncrementAndGet() 공개 메소드

Increments the sequence and stores the result, as an atomic operation.
public IncrementAndGet ( ) : long
리턴 long

Sequence() 공개 메소드

Construct a new sequence counter that can be tracked across threads.
public Sequence ( long initialValue = InitialCursorValue ) : System.Runtime.InteropServices
initialValue long initial value for the counter
리턴 System.Runtime.InteropServices

SetValue() 공개 메소드

Perform an ordered write of this sequence. The intent is a Store/Store barrier between this write and any previous store.
public SetValue ( long value ) : void
value long The new value for the sequence.
리턴 void

SetValueVolatile() 공개 메소드

Performs a volatile write of this sequence. The intent is a Store/Store barrier between this write and any previous write and a Store/Load barrier between this write and any subsequent volatile read.
public SetValueVolatile ( long value ) : void
value long
리턴 void

ToString() 공개 메소드

Value of the Sequence as a String.
public ToString ( ) : string
리턴 string