[cpp-threads] modes, pass 2
Peter Dimov
pdimov at mmltd.net
Sun May 8 15:46:31 BST 2005
Doug Lea wrote:
[...]
> fallible_compare_and_set_ordered(cmp, val) // LL/SC-friendly
[...]
> The "ordered" suffix needs a better name, but the intent
> is that it is the lightest barrier (often no-op) that
> prevents re-orderings of successive loads (for get_ordered)
> or stores (for set_ordered) or operations on the same
> variable (for CAS_ordered).
I don't understand fallible_*, and I don't understand *_ordered. Sorry. :-)
> For example, on x86 and sparc, only store_release needs
> an explict barrier (or locked xchg).
I think that all stores are _release on x86 and sparc TSO; no barrier is
needed.
(As an aside, there are rumors that most/all existing Itaniums operate in a
TSO-like mode, with all stores having release semantics. If true, this
explains why the .acq versions of CAS and fetchadd are more expensive than
the .rel versions.)
More information about the cpp-threads
mailing list