I found some definitions in boost/detail/atomic_count.hpp, with gcc,
win32, etc. flavors. I still haven't figured out how they are used! But
at least there is source to play with.
- mo
On Mon, 2003-09-08 at 22:13, Jack O'Quin wrote:
Michael Ost <most(a)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