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
.
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.
On Tue, 2003-08-19 at 06:01, Ingo Oeser wrote:
Hi Jack,
On Sun, Aug 17, 2003 at 12:56:09PM -0500, Jack O'Quin wrote:
All I've found so far are...
(*) kernel implementations of <asm/atomic.h> and <asm/system.h>.
Don't use these, if glibc supports your architecture.
But, I prefer to avoid using kernel header
files in application
code, mostly for portability and maintenance reasons.
Distributions handle them in non-standard ways, making it hard
to explain to users how to resolve the dependency. Also,
porting to non-Linux platforms becomes problematic.
And as there might be privilegded operations involved, these
headers are a big no-no.
(*) 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.
These I use myself and I can recommend them, as long as you use
GCC or a compatible compiler. They are mad for user space and
survive even preemption quite well.
Regards
Ingo Oeser