Created on 2012-02-22.00:00:00 last changed 130 months ago
Proposed resolution:
This wording is relative to N3376.
[Drafting note: The project editor is kindly asked to consider to replace in [intro.multithread] p17 the phrase "before an operation B on M" by "before a modification B of M".]
Change [atomics.order] paragraph 7 as indicated: [Drafting note: Note that the wording change intentionally does also replace the term atomic operation by atomic modification]
-7- For atomic operations A and B on an atomic object M, if there are
memory_order_seq_cst fences X and Y such that A is sequenced before X,
Y is sequenced before B, and X precedes Y in S, then B
occurs later than A in the modification order of M.
For atomic modifications A and B of an atomic object M, B occurs
later than A in the modification order of M if:
[ 2013-04-20, Bristol ]
Accepted for the working paper
[ 2012, Portland: move to Review ]
Olivier: does the fence really participate in the modifications?
Hans: S is the total set of all sequentially consistent operations, and sequentially consistent fences are in S.
Olivier: this sort of combination of a pair of half-open rules seems to imply the write must make it to main memory
But not all implementations treat a fence as a memory operation; cannot observe the half-open rule.
Hans: not sure this is actually prevented here. You could defer until the next load. What the wording doesn't quite show is that the third bullet in the new wording is already in the standard.
Hans: it is the interaction between fences on one side and other memory modifications on the other that is being defined here.
Pablo: S is not directly observable; it is a hypothetic ordering.
Moved to review
Hans: to alert C liaison
[ 2012-03-20: Hans comments ]
The usage of the term atomic operations in [atomics.order] p7 is actually incorrect and should better be replaced by atomic modifications as used in the C11 407 wording.
There seems to be a similar wording incorrectness used in [intro.multithread] p17 which should be corrected as well.[ 2012-03-19: Daniel proposes a slightly condensed form to reduce wording duplications ]
C11 issue 407
It seems that both C11 and C++11 are missing the following two derivatives of this rule:
For atomic modifications A and B of an atomic object M, if there is a memory_order_seq_cst fence X such that A is sequenced before X, and X precedes B in S, then B occurs later than A in the modification order of M.
For atomic modifications A and B of an atomic object M, if there is a memory_order_seq_cst fence Y such that Y is sequenced before B, and A precedes Y in S, then B occurs later than A in the modification order of M.
Above wording has been suggested for the Technical Corrigendum of C11 via issue 407, details can be found here.
History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-20 13:20:35 | admin | set | status: wp -> c++14 |
2013-04-25 19:07:07 | admin | set | status: voting -> wp |
2013-04-20 08:17:49 | admin | set | messages: + msg6493 |
2013-04-20 08:17:49 | admin | set | status: review -> voting |
2012-11-02 22:48:46 | admin | set | messages: + msg6246 |
2012-11-02 22:48:46 | admin | set | status: new -> review |
2012-03-20 20:15:43 | admin | set | messages: + msg6068 |
2012-03-19 21:51:22 | admin | set | messages: + msg6067 |
2012-03-05 23:20:36 | admin | set | messages: + msg6045 |
2012-02-22 00:00:00 | admin | create |