Re: [LAD] Atomic Operations

From: Stephen Sinclair <radarsat1@email-addr-hidden>
Date: Tue Dec 15 2009 - 20:51:08 EET

On Tue, Dec 15, 2009 at 1:33 PM, Gabriel M. Beddingfield
<gabriel@email-addr-hidden> wrote:
>
> Hi Tim,
>
> On Tue, 15 Dec 2009, Tim Blechmann wrote:
>
>>> http://github.com/radarsat1/dimple/blob/master/src/CircBuffer.h
>>
>> 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
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Wed Dec 16 00:15:02 2009

This archive was generated by hypermail 2.1.8 : Wed Dec 16 2009 - 00:15:02 EET