[zeromq-dev] atomic ops
steven.mccoy at miru.hk
Wed Feb 8 15:19:11 CET 2012
On 7 February 2012 23:34, john skaller <skaller at users.sourceforge.net>wrote:
> I am looking at the atomic ops stuff, and I find this a bit suspicious,
> and also suboptimal:
It's as optimal as GCC's intrinsics, better than Oracle Studio's intrinsics
and compatible with older GCC compilers.
> Wouldn't it be better to use this function:
> type __sync_fetch_and_add (type *ptr, type value, ...)
> which is guaranteed to work on all processors?
There's already a version check in there somewhere, with fallback to a
mutex. GCC 4.0.1 it made an appearance, so GCC 3 and 2 are not supported,
i.e. older versions of RHEL.
Compare with my atomics:
Of note, Apple added their own intrinsics in addition to GCC, odd.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev