5 ms·
I would like to read more about what you described here. Know of any good articles or open source projects where this is done?
by 885895 11y ago
I would like to read more about what you described here. Know of any good articles or open source projects where this is done?
- fmstephe 11y agoIf you like Go I have written a ringbuffer library here https://github.com/fmstephe/flib https://github.com/fmstephe/flib have a look in queues/spscq. spsc here stands for single producer, single consumer. I gave a talk in London about these queues here https://skillsmatter.com/skillscasts/6163-high-performance-single-producer-single-consumer-in-memory-queue https://skillsmatter.com/skillscasts/6163-high-performance-s... ------------------- But all of this work is based on the work, and teaching, of Martin Thomson. Martin Thomson has published a large collection of data structures (which probably include these ringbuffers (I haven't checked specifically)) https://github.com/real-logic/Agrona https://github.com/real-logic/Agrona If you are near Ireland I highly recommend Martin Thomson's concurrency course http://instil.co/courses/writing-concurrent-code-with-lock-free-algorithms/ http://instil.co/courses/writing-concurrent-code-with-lock-f... ---------- I highly recommend Nitsan Wakart's blog. He covers a lot of interesting ground, all in Java. Probably best to start at the early blog posts and work your way forward. http://psy-lob-saw.blogspot.co.uk/ http://psy-lob-saw.blogspot.co.uk/ Nitsan contributes to a very focused java library here https://github.com/JCTools/JCTools https://github.com/JCTools/JCTools
- ryanjshaw 11y agoWhy: https://github.com/LMAX-Exchange/disruptor/wiki/Blogs-And-Articles https://github.com/LMAX-Exchange/disruptor/wiki/Blogs-And-Ar... Java: https://lmax-exchange.github.io/disruptor/ https://lmax-exchange.github.io/disruptor/ .NET: https://github.com/disruptor-net/Disruptor-net https://github.com/disruptor-net/Disruptor-net
- btown 11y agoThere are multiple ways to make a lock-free ringbuffer; most use some sort of similar trick with per-consumer atomic counters, though I hadn't heard of something as simple as the minimum-modulo trick described in the gp! Some implementations: http://mechanitis.blogspot.com/2011/07/dissecting-disruptor-writing-to-ring.html http://mechanitis.blogspot.com/2011/07/dissecting-disruptor-... http://www.boost.org/doc/libs/1_59_0/doc/html/boost/lockfree/queue.html http://www.boost.org/doc/libs/1_59_0/doc/html/boost/lockfree... - hard to find implementation details though http://moodycamel.com/blog/2014/a-fast-general-purpose-lock-free-queue-for-c++ http://moodycamel.com/blog/2014/a-fast-general-purpose-lock-... (uses per-producer counters instead, and relaxes some ordering guarantees; see comments)