On Tue, Dec 15, 2009 at 1:33 PM, Gabriel M. Beddingfield
<gabriel(a)teuton.org> wrote:
Hi Tim,
On Tue, 15 Dec 2009, Tim Blechmann wrote:
you should add memory barriers, when reading or writing to the reader or
Actually, his implementation is similar to ringbuffer.c in
libjack... and assumes that reading and writing can happen
atomically (as was pointed out by someone else) -- which can
be managed with single reader / single writer
requirement.[a]
Yes, sorry I should have stated the single/single requirement.
I'm not really sure about memory barriers and where and when they're
needed. In any case I've been using this code successfully for
message passing between threads. I'm sure there is better code out
there (like in boost), but I just like that it's self-contained.
Steve