Ring Buffer - A Data Structure Behind Disruptor

https://dzone.com/articles/ring-buffer-a-data-structure-behind-disruptor

Very interesting but light on detail. What are the memory semantics of this buffer? The article references the fact that Disruptor as a whole uses lock-fee structures — is this ring buffer one of them?

Disruptor is a high-performance library for passing messages between threads,

Ring buffer (…) is basically a linear data structure in which the end points to the beginning of the structure. It’s easy to reason about it as a circular array without the end.

2020-10-20-1202242.png

As you can imagine, a ring buffer is mostly used as a queue.

2020-10-20-6808070.png

As you can see, we have a single message being sent to the input queues of multiple consumers (1-4) - so it’s a typical multicast (sort of publish and subscribe semantics). Then we have a barrier - we want all consumers to finish processing the message before we move to the next step. When the barrier is passed, the message goes to the input queue of the last consumer.

What are consumers in this context? Nodes? Processes/threads?

The barrier is implemented in a way that dependant consumer cannot go past any of the consumers which are required to be finished before it starts processing a ring buffer item (a message). 

Edit