__atomic_add support without gthreads
DARIN JOHNSON
darin@usa.net
Mon Feb 23 22:58:00 GMT 2009
>Alternatively, if you just want to write code which uses atomic
>operations, but you don't need the library to have multi-threaded
>support, then use the builtin __sync_XXX functions, not
>__atomic_add_dispatch and friends.
Yes, I definately have my own inline functions for atomic operations.
However, the case isn't that I want to call these functions directly,
but could use them indirectly when calling some libstdc++ classes
and templates.
I think some of the confusion on my part is that I sort of assumed
the gthreads was needed for mutex support and vice versa; and that
any "lock free" operation would be orthagonal to the availability
of gthreads. But this doesn't seem to be the case.
--
Darin Johnson
More information about the Libstdc++
mailing list