Re: [LAD] Atomic Operations

PrevNext  Index
DateTue, 15 Dec 2009 20:42:33 +0100
From Olivier Guilyardi <[hidden] at samalyse dot com>
ToPaul Davis <[hidden] at linuxaudiosystems dot com>
CcTim Blechmann <[hidden] at klingt dot org>, [hidden] at lists dot linuxaudio dot org
In-Reply-ToPaul Davis Re: [LAD] Atomic Operations
Follow-UpSean Bolton Re: [LAD] Atomic Operations
On 12/15/2009 08:04 PM, Paul Davis wrote:
> 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.

No, to me the conclusion was: we can't programmatically prove that memory
barriers are needed (even on the most vulnerable architectures), but the theory
say that they are, and they should be added for correctness.

--
  Olivier
PrevNext  Index

1260906179.10166_0.ltw:2,a <4B27E6A9.6000505 at samalyse dot com>