Boost logo

Boost :

Subject: Re: [boost] Boost.Future & review of C++0x accepted libraries implementations
From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2008-11-26 08:42:39


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk