Re: [LAD] Atomic Operations

From: Sean Bolton <musound@email-addr-hidden>
Date: Wed Dec 16 2009 - 02:11:08 EET

Yikes, not this again....

On Dec 15, 2009, at 11:42 AM, Olivier Guilyardi wrote:
> On 12/15/2009 08:04 PM, Paul Davis wrote:
>> 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.

My understanding matches Olivier's. Intel processors have strong memory
ordering, and so on them the jack ringbuffer is safe without memory
barriers. However, some PPC processors, and SPARC V9s under linux
(but not
Solaris), use weak memory ordering, and on them, the jack ringbuffer
code
can theoretically fail.

See the "ring buffer memory barriers" discussion on jack-devel back in
October of last year for more information; in particular, this article
by Paul E. McKenney is very helpful:

http://www.linuxjournal.com/article/8211

And, until the jack ringbuffer gets fixed, the PortAudio ringbuffer
appears safe for use on multiprocessor weakly-ordered systems.

-Sean

_______________________________________________
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 04:15:03 2009

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