Ringbuffer library


Up  |  Previous  |  Next  |  Down

I originally made this library because I needed a good ringbuffer that would allow me to read from it with more than one output. The newer version was made for a similar reason, but I didn't need to read from it with more than one output and I wanted it to be reasonably lean.

Both versions are written in C++ (although the new one could reasonably easily be ported to C), the older library uses templates to allow for an arbitrary data types in the buffer (including blocks of data, note however that the data type should allow the use of memcpy to be moved/copied), it is quite flexible, speed should be okay, although it isn't heavily optimized (the newer version should be quite a bit faster than the old version, especially since it should require no form of locking). Both are distributed under a BSD-ish license, which means you can do just about anything with it, if you make any interesting changes, please be so kind as to send them to me.

The latest version of the old (multiple reader) library was uploaded on June 8, 2003.
The latest version of the new (single reader) library was uploaded on December 29, 2004.

To download please click on the link:
Single reader ringbuffer library (6 KB)
Some minor changes to interlocked.asm, should be slightly faster now.
Previous release notes: First release, but as far as I know it works. This library should not need any locking or other form of synchronization.
Multiple reader ringbuffer library (11 KB)
First release, basic functionality works. You should use locks around at least the calls to the read (and probably also write) functions.
If you have any questions, just mail me.

Current features:
  Single reader:   Multiple reader version: Known bugs: Version history single reader version:
January 7, 2005: December 29, 2004 (first release):
Version history multiple reader version:
June 8, 2003 (first release):
Up  |  Previous  |  Next  |  Down


To contact me, please mail to: th.v.d.gronde@hccnet.nl
I hope you'll enjoy my program(s).