[LAD] Atomic Operations

Tim Blechmann tim at klingt.org
Wed Dec 16 09:43:57 UTC 2009


>>> 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.

exactly, the issue may not appear on x86, because of its memory
consistency, weakly-ordered machines will need some barriers ...


> 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

memory-barriers.txt of the linux kernel documentation is interesting as
well ...

cheers, tim

-- 
tim at klingt.org
http://tim.klingt.org

Contrary to general belief, an artist is never ahead of his time but
most people are far behind theirs.
  Edgar Varèse

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20091216/6d4481b4/attachment.pgp>


More information about the Linux-audio-dev mailing list