[LAD] Atomic Operations

Paul Davis paul at linuxaudiosystems.com
Tue Dec 15 19:04:27 UTC 2009


On Tue, Dec 15, 2009 at 1:47 PM, Tim Blechmann <tim at klingt.org> 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]
>>
>> Unless I've misunderstood the code, ringbuffer.c is /not/
>> using special atomic operations.
>
> the jack ringbuffer code is not multiprocessor safe then ... it is prbly
> not an issue for jack1, but maybe for jack2, if it is used there ...

this was discussed at some considerable length on jack-devel last year, IIRC.
for single reader/single writer ringbuffers, i believe that we
concluded that memory barriers are not necessary.



More information about the Linux-audio-dev mailing list