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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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