[linux-audio-dev] userspace atomic primitives for multithread and SMP applications?

Tim Hockin thockin at hockin.org
Mon Aug 18 17:23:01 UTC 2003


On Sun, Aug 17, 2003 at 12:56:09PM -0500, Jack O'Quin wrote:
> 
> I am looking for a good set of portable, supported atomic.h-style
> primitives for userspace applications.  I am not especially interested
> in the low-level functions defined in <asm/atomic.h>.  I really want
> something more powerful like the kernel's compare_and_swap(),
> cmpxchg(), test_and_set(), atomic_inc_and_return(), or fetch_and_add()

These are intrinsically platform specific.

>   (*) glibc seems to have a good set of functions internally
> 
>       AFAICT, these are for the library's own use, not part of the
>       supported external interface.  I'll investigate further.

It sure would be nice if glibc exposed an atomic API.  I dunno how much you
can do as a user, though.  Can non-privileged tasks run LOCKed instructions
on x86?  How about other architectures?


-- 
Notice that as computers are becoming easier and easier to use,
suddenly there's a big market for "Dummies" books.  Cause and effect,
or merely an ironic juxtaposition of unrelated facts?




More information about the Linux-audio-dev mailing list