[cpp-threads] Failed compare-and-swap

Alexander Terekhov alexander.terekhov at gmail.com
Tue Jul 31 20:18:56 BST 2007


On 7/31/07, Herb Sutter <hsutter at microsoft.com> wrote:
[...]
> So the question here is whether we want to support the technique of using a CAS
> to perform an atomic read. Do we? We can say yes by returning the old value, or
> no by returning a succeeded/failed bool.

Model it on load-locked/reserved+compare+store-conditional and let
application specify both leading and trailing unidirectional
hoist/sink constraints with an option to specify different trailing
constraints for success and failure on compare. And let it also
indicate whether validation (store of loaded value) is needed on
compare failure as well.

regards,
alexander.



More information about the cpp-threads mailing list