C# Class 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.
Afficher le fichier Open project: disruptor-net/Disruptor-net Class Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

AddAndGet() public méthode

Increments the sequence and stores the result, as an atomic operation.
public AddAndGet ( long value ) : long
value long
Résultat long

CompareAndSet() public méthode

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
Résultat bool

IncrementAndGet() public méthode

Increments the sequence and stores the result, as an atomic operation.
public IncrementAndGet ( ) : long
Résultat long

Sequence() public méthode

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
Résultat System.Runtime.InteropServices

SetValue() public méthode

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.
Résultat void

SetValueVolatile() public méthode

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
Résultat void

ToString() public méthode

Value of the Sequence as a String.
public ToString ( ) : string
Résultat string