Re: [LAD] Atomic Operations

From: Olivier Guilyardi <list@email-addr-hidden>
Date: Tue Dec 15 2009 - 21:42:33 EET

On 12/15/2009 08:04 PM, Paul Davis wrote:
> On Tue, Dec 15, 2009 at 1:47 PM, Tim Blechmann <tim@email-addr-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
_______________________________________________
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