This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: __atomic_add support without gthreads
- From: "DARIN JOHNSON" <darin at usa dot net>
- To: <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 23 Feb 2009 14:58:35 -0800
- Subject: Re: __atomic_add support without gthreads
- Z-usanet-msgid: XID911NBww7K4672X40
>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