[cpp-threads] D2335 (sequential consistency proof) revision
Boehm, Hans
hans.boehm at hp.com
Fri Aug 24 23:37:00 BST 2007
> From: Chris Thomasson
>
> [...]
>
> Taking a lock does not necessarily require a #StoreLoad | #StoreStore
> barrier. There are asymmetric locking algorithms in which
> certain thread(s)
> can take the lock without using interlocked rmw or store/load
> memory barrier
> instructions.
>
You're presumably talking about cases in which a thread knows that it
held the lock last? Otherwise you inherently need to do something to
ensure that a lock acquisition and a subsequent memory operation M don't
become visible out of order to the previous thread to release the lock,
i.e. that it doesn't see M before the lock release. On many
architectures that does require a fence or some other kind of ordered
memory operation, right?
Hans
More information about the cpp-threads
mailing list