|
Boost : |
Subject: Re: [boost] Boost.Future & review of C++0x accepted libraries implementations
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-11-27 08:42:41
Alexander Terekhov <terekhov_at_[hidden]> writes:
> 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
In raised this on the committee list, and there didn't seem any
support for this idea. LR/SC has to be used at a low level to use the
native instructions, and is therefore not sufficiently useful to make
it worthwhile adding. I won't pursue it further. If you feel strongly
about this, I suggest you try and get your National Body to add a
comment on the CD asking for this.
Anthony
-- Anthony Williams Author of C++ Concurrency in Action | http://www.manning.com/williams Custom Software Development | http://www.justsoftwaresolutions.co.uk Just Software Solutions Ltd, Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk