cplusplus / CWG

Core Working Group
23 stars 7 forks source link

[intro.races] p20 What the value is observed does not imply they would have a "happens before" relationship #369

Open xmh0511 opened 1 year ago

xmh0511 commented 1 year ago

Full name of submitter (unless configured in github; will be published with the issue): Jim X

[intro.races] p20 says:

The value observed by a load of an atomic depends on the “happens before” relation, which depends on the values observed by loads of atomics.

However, which value is observed cannot imply the "happens before" relationship.

[intro.races] p14 says:

The value of an atomic object M, as determined by evaluation B, shall be the value stored by some side effect A that modifies M, where B does not happen before A.

This rule just implies: B may load A if B does not happen before A. However, the note seems to imply: B load A can imply B does not happen before A.

That is P -> Q does not mean Q -> P. The note seems to be a bit misleading here.

frederick-vs-ja commented 1 year ago

I think the value observed by a load of an atomic does depend on the “happens before” relation, but not only on it.

Since [intro.races] p20 is a note, can/should we just remove the sentence editorially?