cplusplus / CWG

Core Working Group
23 stars 7 forks source link

[intro.races] p10 Augment the list to complete the definition #471

Closed xmh0511 closed 10 months ago

xmh0511 commented 10 months ago

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

To be a definition, it has an obligation to tell the complete story to cover all the cases that belong to it. Since, we say whenever A strong happens before B or A simply happens before B is true, A happens before B is true, the definition of "happens before" should cover these cases.

Suggested Resolution

Augment the definition for [intro.races] p10

An evaluation A happens before an evaluation B (or, equivalently, B happens after A) if:

  • A is sequenced before B, or
  • A inter-thread happens before B, or
  • A simply happens before B, or
  • A strongly happens before B.
jensmaurer commented 10 months ago

Rejected; see the other discussion. Unless you can show a specific example that satisfies "strongly happens before", but not "happens before".

xmh0511 commented 10 months ago

Rejected; see the other discussion. Unless you can show a specific example that satisfies "strongly happens before", but not "happens before".

As is that we cannot find an example that satisfies "strongly happens before", but not "happens before", which means, "strongly happens before" can be subsumed to "happens before", so the definition of "happens before" should cover "strongly happens before", which is similar to that "is sequence before" is "happens before".

t3nsor commented 10 months ago

Rejected; see the other discussion. Unless you can show a specific example that satisfies "strongly happens before", but not "happens before".

As is that we cannot find an example that satisfies "strongly happens before", but not "happens before", which means, "strongly happens before" can be subsumed to "happens before", so the definition of "happens before" should cover "strongly happens before", which is similar to that "is sequence before" is "happens before".

So you agree that under the current wording, "strongly happens before" already implies "happens before". That means the wording change that you are proposing has no effect. Then, what is the purpose of changing the wording?

Are you saying that, every time the standard defines two terms A and B, if A implies B, then the definition of B should be redundantly augmented to include A as one of the cases? What would be the purpose of that?