
26 Nov
2008
26 Nov
'08
1:42 p.m.
Anthony Williams wrote: [...]
Given all that 'weak' and 'strong' CAS story, why not standardize something along the lines of
(impl. for CAS/non-native LR(LL)-SC platforms)
load_reserved_weak() { return reserved = load(); // static thread-local variable }
store_conditional_weak(value) { return compare_exchange_weak(reserved, value); }
Are you suggesting these be added to the atomic types?
That would help regarding portability of LR-SC based code that doesn't need ABA*** safety of load_reserved_strong/store_conditional_strong. That would also put pressure on vendors to introduce native LR-SC and on programmers to use LR-SC which is much better primitive than CAS. ***) http://en.wikipedia.org/wiki/ABA_problem regards, alexander.