C# 클래스 Disruptor.SequenceGroup

A Sequence group that can dynamically have Sequences added and removed while being thread safe. The SequenceGroup.Value get and set methods are lock free and can be concurrently called with the SequenceGroup.Add and SequenceGroup.Remove.
상속: ISequence
파일 보기 프로젝트 열기: disruptor-net/Disruptor-net 1 사용 예제들

공개 메소드들

메소드 설명
Add ( ISequence sequence ) : void

Add a Sequence into this aggregate. This should only be used during initialisation. Use SequenceGroup.AddWhileRunning.

AddAndGet ( long value ) : long
AddWhileRunning ( ICursored cursored, Sequence sequence ) : void

Adds a sequence to the sequence group after threads have started to publish to the Disruptor.It will set the sequences to cursor value of the ringBuffer just after adding them. This should prevent any nasty rewind/wrapping effects.

CompareAndSet ( long expectedSequence, long nextSequence ) : bool
IncrementAndGet ( ) : long
Remove ( ISequence sequence ) : bool

Remove the first occurrence of the Sequence from this aggregate.

SetValue ( long value ) : void

Set all Sequences in the group to a given value.

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.

메소드 상세

Add() 공개 메소드

Add a Sequence into this aggregate. This should only be used during initialisation. Use SequenceGroup.AddWhileRunning.
public Add ( ISequence sequence ) : void
sequence ISequence sequence to be added to the aggregate.
리턴 void

AddAndGet() 공개 메소드

public AddAndGet ( long value ) : long
value long
리턴 long

AddWhileRunning() 공개 메소드

Adds a sequence to the sequence group after threads have started to publish to the Disruptor.It will set the sequences to cursor value of the ringBuffer just after adding them. This should prevent any nasty rewind/wrapping effects.
public AddWhileRunning ( ICursored cursored, Sequence sequence ) : void
cursored ICursored The data structure that the owner of this sequence group will be pulling it's events from
sequence Sequence The sequence to add
리턴 void

CompareAndSet() 공개 메소드

public CompareAndSet ( long expectedSequence, long nextSequence ) : bool
expectedSequence long
nextSequence long
리턴 bool

IncrementAndGet() 공개 메소드

public IncrementAndGet ( ) : long
리턴 long

Remove() 공개 메소드

Remove the first occurrence of the Sequence from this aggregate.
public Remove ( ISequence sequence ) : bool
sequence ISequence sequence to be removed from this aggregate.
리턴 bool

SetValue() 공개 메소드

Set all Sequences in the group to a given value.
public SetValue ( long value ) : void
value long value to set the group of sequences to.
리턴 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