disruptor 核心概念

Ring Buffer:  The Ring Buffer is often considered the main aspect of the Disruptor, however from 3.0 onwards the Ring Buffer is only responsible for the storing and updating of the data (Events) that move through the Disruptor.  And for some advanced use cases can be completely replaced by the user.java


Sequence:  The Disruptor uses Sequences as a means to identify where a particular component is up to.  Each consumer (EventProcessor) maintains a Sequence as does the Disruptor itself.  The majority of the concurrent code relies on the the movement of these Sequence values, hence the Sequence supports many of the current features of an AtomicLong.  In fact the only real difference between the 2 is that the Sequence contains additional functionality to prevent false sharing between Sequences and other values.git

Sequencer:  The Sequencer is the real core of the Disruptor.  The 2 implementations (single producer, multi producer) of this interface implement all of the concurrent algorithms use for fast, correct passing of data between producers and consumers.github

Sequence Barrier:  The Sequence Barrier is produced by the Sequencer and contains references to the main published Sequence from the Sequencer and the Sequences of any dependent consumer.  It contains the logic to determine if there are any events available for the consumer to process.ide

Wait Strategy:  ss  More details are available in the section about being optionally lock-free.
this

相關文章
相關標籤/搜索