Re: [linux-audio-dev] lock-free ring buffer code

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] lock-free ring buffer code
From: Paul Davis (paul_AT_linuxaudiosystems.com)
Date: Tue Apr 08 2003 - 13:52:10 EDT


>> The glibc has internal support for atomic operations (at least
>> atomic_add() is there and allows a negative argument, so
>> atomic_sub() is there too and exchange_and_add(&lff->filled, 0)
>> will provide an atomic read), so there is no problem about
>> portability on Linux systems (and even other systems).
>
>You should probably special case architectures where 32bit read/write is
>atomic, as its a common case at the moment.

the kernel code for atomic_t does this already. atomic_inc(atomic_t* a)
resolves to a++ or something like that.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Apr 08 2003 - 14:01:51 EDT