[cpp-threads] C++ memory model
Boehm, Hans
hans.boehm at hp.com
Tue Sep 22 21:12:33 BST 2009
> From: Lawrence Crowl [mailto:crowl at google.com]
> Sent: Tuesday, September 22, 2009 12:44 AM
>
> 8.7 section 29.3 paragraph 9
>
> | Deleting "Implementations shall not ... out of an unbounded loop."
> | Adding "An atomic operation contained in a substatement of
> one of the
> | iteration statements specified in 6.5 must not be moved out of the
> | substatement."
>
> The added sentence is okay in direction, but the wording does
> not reflect the fact that the standard likes "shall" and the
> standard likes to specify whether requirements are on the
> implementation or the program. I would rewrite that statement as:
>
> The implementation shall not move an atomic side effect contained
> in a substatement of one of the iteration statements specified in
> 6.5 out of the substatement.
I still have a general problem with all forms of this sentence, in that it doesn't seem to be a constraint on observable program behavior. The program can't tell whether it was moved out of the loop or just held in a local store buffer indefinitely. It seems to me that the most we can really properly state is precisely what's already said in the preceding sentence.
I think this sentence should just disappear.
Does Clark have an opinion?
Hans
More information about the cpp-threads
mailing list