3 ms·
The double-mapped ring buffer trick is so clever I can't help but wish I invented it. :) Here's the code for the GNU radio implementation described in the arti
by hoytech 10y ago
The double-mapped ring buffer trick is so clever I can't help but wish I invented it. :)
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:
https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/vmcircbuf_createfilemapping.cc https://github.com/gnuradio/gnuradio/blob/master/gnuradio-ru...
https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/vmcircbuf_mmap_shm_open.cc https://github.com/gnuradio/gnuradio/blob/master/gnuradio-ru...
https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/vmcircbuf_mmap_tmpfile.cc https://github.com/gnuradio/gnuradio/blob/master/gnuradio-ru...
And here some other links to implementations I've collected:
http://vrb.sourceforge.net/ http://vrb.sourceforge.net/
https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buffer/ https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buff...
https://gist.github.com/rygorous/3158316 https://gist.github.com/rygorous/3158316
https://www.mikeash.com/pyblog/friday-qa-2012-02-03-ring-buffers-and-mirrored-memory-part-i.html https://www.mikeash.com/pyblog/friday-qa-2012-02-03-ring-buf...
https://www.mikeash.com/pyblog/friday-qa-2012-02-17-ring-buffers-and-mirrored-memory-part-ii.html https://www.mikeash.com/pyblog/friday-qa-2012-02-17-ring-buf...
https://github.com/mikeash/MAMirroredQueue https://github.com/mikeash/MAMirroredQueue
http://atastypixel.com/blog/a-simple-fast-circular-buffer-implementation-for-audio-processing/ http://atastypixel.com/blog/a-simple-fast-circular-buffer-im...
https://github.com/michaeltyson/TPCircularBuffer https://github.com/michaeltyson/TPCircularBuffer
http://www.koanlogic.com/libu/api/html/group__rb.html http://www.koanlogic.com/libu/api/html/group__rb.html
https://github.com/ulfalizer/botniklas/blob/master/src/read_msg.c https://github.com/ulfalizer/botniklas/blob/master/src/read_...
https://github.com/willemt/cbuffer https://github.com/willemt/cbuffer