Re: [LAD] Atomic Operations

PrevNext  Index
DateTue, 15 Dec 2009 14:04:27 -0500
From Paul Davis <[hidden] at linuxaudiosystems dot com>
ToTim Blechmann <[hidden] at klingt dot org>
Cc[hidden] at lists dot linuxaudio dot org
Follow-UpOlivier Guilyardi Re: [LAD] Atomic Operations
On Tue, Dec 15, 2009 at 1:47 PM, Tim Blechmann <[hidden]> 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.
PrevNext  Index

1260903888.5014_0.ltw:2,a <eb4b5e1d0912151104t1ccc6b7fvcf519a096fedae2e at mail dot gmail dot com>