[cpp-threads] Weak vs Strong Atomics

Anthony Williams anthony at justsoftwaresolutions.co.uk
Tue May 8 16:02:56 BST 2007


"Lawrence Crowl" <Lawrence at Crowl.org> writes:

> On 5/4/07, Anthony Williams <anthony at justsoftwaresolutions.co.uk> wrote:
>> "Lawrence Crowl" <Lawrence at Crowl.org> writes:
>> > Based on these two observations, I would like to keep the current
>> > design for atomics, which is a single atomic type and a functional
>> > interface to all operations and an operator interface to the strong
>> > operations.
>>
>> Doing so does not allow for the possibility of a strong atomic where all
>> operations are guaranteed SC. I am not happy with this.
>
> What problem are you trying to solve?  Are you trying to prevent a
> weak view from interfering with a strong view?  Are you trying to
> enforce a coding guideline?

I am trying to enforce a coding guideline, with an eye to ensuring that the
"strong view" is upheld. If there is code that uses strong atomics exclusively
it's easier to think about (that is why everyone likes SC, after all). If some
operations are weak, then you have to think about where they become visible,
and so forth at a much more detailed level. I want it to be clearly flagged
"this variable is a weak atomic, and you have to use it carefully". Allowing
for conversions either way is potentially problematic in this regard.

Anthony
-- 
Anthony Williams
Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL



More information about the cpp-threads mailing list