[cpp-threads] modes, pass 2

Peter Dimov pdimov at mmltd.net
Mon May 9 13:28:42 BST 2005


Alexander Terekhov wrote:
>
> Fallible CAS can be used in unlock(), but what about reduntant loads
> (in the case of CAS-based variation) in lock()?

The redundant load will always hit the L1 cache. The perf hit is negligible. 
B.4 even says that "in some implementations, better performance may be 
obtained by using a regular Load to do the initial checking."

The other examples aren't expressible with CAS, though. 





More information about the cpp-threads mailing list