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

Jack O'Quin joq at io.com
Tue Sep 9 01:29:00 UTC 2003


Michael Ost <most at museresearch.com> writes:

> I know this message is ancient, but if you are still looking for atomic
> primitives I just ran across some in the boost code base. I can't figure
> out how to use them (!) but perhaps you can? Boost, if you don't know,
> seems to be kind of a proving ground for the C++ working group. Lots of
> libraries which are cross platform and written by smart people. See
> www.boost.org.
> 
> Hope this helps... mo
> 
> PS At least the code might provide some hints for how to implement
> atomic primitives yourself. The code is open, but not GPLd.

Thanks for the pointer, mo.

Where are these primitives actually defined?  I found this in
once.cpp...

  // The friendly form of InterlockedCompareExchange that defers
  // according to the above function type wrappers.
  inline LONG compare_exchange(volatile LPLONG dest, LONG exch, LONG cmp)
  {
      return ice_wrapper(&InterlockedCompareExchange, dest, exch, cmp);
  }

But, I can't figure out where the ice_wrapper stuff is defined.  I
suspect it may be the interesting part, some kind of machine-dependent
layer.

Regards,
-- 
  Jack O'Quin
  Austin, Texas, USA



More information about the Linux-audio-dev mailing list