Closed xmh0511 closed 7 months ago
That's exactly the point here: A does not (necessarily) happen before B, thus the value of v read at B is either the value stored by A or the initial value of v (i.e. 0).
I'm not seeing a defect here, and I repeat my earlier statement: This forum is not a tutorial for reading the standard. The memory model descriptions are particularly intricate; please familiarize yourself with partial orders.
@jensmaurer The issue may be my misread. If the condition in the list of [intro.races] p10 is not met, then A
happens before B
is false, so, the negtivation of A
happens before B
is true.
Full name of submitter (unless configured in github; will be published with the issue): Jim X
Consider this example:
[intro.races] p14 imposes the requirement to limit which values can be possibly read by
B
, which says:This rule limits which values can be possibly read by
B
. The rules after p14 impose other requirements but they are irrelevant here. Note the emphasized wording, to be the value read byB
, the requirement thatB
does not happen beforeA
should be satisfied. We either directly prove the condition is true or prove the opposition is false. Since we didn't define the concept thatX
does not happen beforeY
, we just define howX
happens beforeY
, hence, in order to proveB
does not happen beforeA
is true, we need to proveB
happens beforeA
is false. The opposition is false can prove!( A happens before B)
is true.However, in this example, according to the definition of "happens before", we cannot prove that
B
happens beforeA
is false, which means, we cannot prove the condition thatB
does not happen beforeA
is true. This is, we cannot check the condition in [intro.races] p14 for the above example. Does it mean whetherB
can readA
is underspecified?Suggested Resolution
When checking [intro.races] p14, how to check the condition "B does not happen before A" is true?