ringbuffer, with "LMAX Disruptor" semantics - liblfds.org https://www.liblfds.org/forum/index.php/7/ringbuffer-with-lmax-disruptor-semantics/ Wed, 30 Jan 2019 23:43:18 +0000 esoTalk admin https://www.liblfds.org/forum/index.php/post/9/ <p>Good evening.</p><p>I must apologise profusely for what must be the slowest reply I&#39;ve made in my life.</p><p>A number of other things have been on the go - I have to write a book and moving house *and* arranging a friend to come and stay for a couple of weeks - and I&#39;ve not checked the forum in a timely manner.</p><p>&gt; Liblfds has a ringbuffer implementation<br/>&gt; [snip]<br/>&gt; but its semantics is that of a queue at the reader&#39;s side</p><p>Yes. There can be many readers, but a single element can only be read by a single reader.</p><p>&gt; For our robotics and vision processing applications, we would prefer a different semantics, namely the one of the &quot;LMAX Disruptor&quot;</p><p>Do you mean *just* the ringbuffer from LMAX Disruptor, or the whole thing?</p><p>I&#39;ve had a look and found a document or two about their ringbuffer.</p><p>It appears to be the same design at the circular buffer used in the Linux kernel, but presumably modified to use atomic operations rather than only memory barriers (I looked at the source, but it was impenetrable at five minutes of examination).</p><p>That design is present in 7.1.1 in both forms.</p><p>The bounded, single producer, single consumer queue is this design using memory barriers only.</p><p>The bounded, many producer, many consumer queue is this design using atomic operations.</p><p>However, I have missed something here because the semantics remain queue-like for the reader.</p><p>Perhaps you&#39;re thinking of the LMAX DIsrupter as a whole, rather than just the ringbuffer?</p> Wed, 30 Jan 2019 23:41:08 +0000 https://www.liblfds.org/forum/index.php/post/9/ bruyninc https://www.liblfds.org/forum/index.php/post/8/ <p>Liblfds has a ringbuffer implementation<br/> &lt;http://www.liblfds.org/mediawiki/index.php?title=r7.1.1:Ringbuffer&gt;<br/>but its semantics is that of a queue at the reader&#39;s side.</p><p>For our robotics and vision processing applications, we would prefer a different semantics,<br/>namely the one of the &quot;LMAX Disruptor&quot;<br/> &lt;http://lmax-exchange.github.io/disruptor/&gt;<br/> &lt;https://github.com/LMAX-Exchange/disruptor/wiki/Introduction&gt;</p><p>Is someone interested on discussing the design with us?<br/>Or maybe someone _has_ already some code that can be shared?</p><p>Would it be an acceptable addition to the project, to start with?</p><p>Best regards,</p><p>Herman Bruyninckx<br/>KU Leuven, Belgium</p> Fri, 11 Jan 2019 09:48:45 +0000 https://www.liblfds.org/forum/index.php/post/8/