liblfds.org

  ringbuffer, with "LMAX Disruptor" semantics

Tags
 
Labels
Members allowed to view this conversation
Everyone

Liblfds has a ringbuffer implementation
<http://www.liblfds.org/mediawiki/index.php?title=r7.1.1:Ringbuffer>
but its semantics is that of a queue at the reader's side.

For our robotics and vision processing applications, we would prefer a different semantics,
namely the one of the "LMAX Disruptor"
<http://lmax-exchange.github.io/disruptor/>
<https://github.com/LMAX-Exchange/disruptor/wiki/Introduction>

Is someone interested on discussing the design with us?
Or maybe someone _has_ already some code that can be shared?

Would it be an acceptable addition to the project, to start with?

Best regards,

Herman Bruyninckx
KU Leuven, Belgium


admin

3 months ago (edited by admin 3 months ago) Administrator

Good evening.

I must apologise profusely for what must be the slowest reply I've made in my life.

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've not checked the forum in a timely manner.

> Liblfds has a ringbuffer implementation
> [snip]
> but its semantics is that of a queue at the reader's side

Yes. There can be many readers, but a single element can only be read by a single reader.

> For our robotics and vision processing applications, we would prefer a different semantics, namely the one of the "LMAX Disruptor"

Do you mean *just* the ringbuffer from LMAX Disruptor, or the whole thing?

I've had a look and found a document or two about their ringbuffer.

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).

That design is present in 7.1.1 in both forms.

The bounded, single producer, single consumer queue is this design using memory barriers only.

The bounded, many producer, many consumer queue is this design using atomic operations.

However, I have missed something here because the semantics remain queue-like for the reader.

Perhaps you're thinking of the LMAX DIsrupter as a whole, rather than just the ringbuffer?


You need to log in or create an account to perform any action on this forum.