The double-mapped ring buffer trick is so clever I can't help but wish I invented it. :)<p>Here's the code for the GNU radio implementation described in the article, it's a good reference for some various ways to set up the mappings:<p><a href="https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/vmcircbuf_createfilemapping.cc" rel="nofollow">https://github.com/gnuradio/gnuradio/blob/master/gnuradio-ru...</a>
<a href="https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc" rel="nofollow">https://github.com/gnuradio/gnuradio/blob/master/gnuradio-ru...</a>
<a href="https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/vmcircbuf_mmap_tmpfile.cc" rel="nofollow">https://github.com/gnuradio/gnuradio/blob/master/gnuradio-ru...</a><p>And here some other links to implementations I've collected:<p><a href="http://vrb.sourceforge.net/" rel="nofollow">http://vrb.sourceforge.net/</a><p><a href="https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buffer/" rel="nofollow">https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buff...</a>
<a href="https://gist.github.com/rygorous/3158316" rel="nofollow">https://gist.github.com/rygorous/3158316</a><p><a href="https://www.mikeash.com/pyblog/friday-qa-2012-02-03-ring-buffers-and-mirrored-memory-part-i.html" rel="nofollow">https://www.mikeash.com/pyblog/friday-qa-2012-02-03-ring-buf...</a>
<a href="https://www.mikeash.com/pyblog/friday-qa-2012-02-17-ring-buffers-and-mirrored-memory-part-ii.html" rel="nofollow">https://www.mikeash.com/pyblog/friday-qa-2012-02-17-ring-buf...</a>
<a href="https://github.com/mikeash/MAMirroredQueue" rel="nofollow">https://github.com/mikeash/MAMirroredQueue</a><p><a href="http://atastypixel.com/blog/a-simple-fast-circular-buffer-implementation-for-audio-processing/" rel="nofollow">http://atastypixel.com/blog/a-simple-fast-circular-buffer-im...</a>
<a href="https://github.com/michaeltyson/TPCircularBuffer" rel="nofollow">https://github.com/michaeltyson/TPCircularBuffer</a><p><a href="http://www.koanlogic.com/libu/api/html/group__rb.html" rel="nofollow">http://www.koanlogic.com/libu/api/html/group__rb.html</a><p><a href="https://github.com/ulfalizer/botniklas/blob/master/src/read_msg.c" rel="nofollow">https://github.com/ulfalizer/botniklas/blob/master/src/read_...</a><p><a href="https://github.com/willemt/cbuffer" rel="nofollow">https://github.com/willemt/cbuffer</a>
SDR strikes me as good in theory, but breaks down for anything practical.<p>My core 2 duo was 100% cpu utilization simply from decoding 56kbps 2-BPSK, even with SIMD extension enabled (within GR).