You probably paid attentions that the text is not crystal clear.
It looks like authors of the Standard invent their own terminology not
only when absolutely necessary but sometimes even when there exist established terms for the same things. To their defense, I could say
that in the branch of CS that is related to concurrency and parallelism
very few terms are 100% consensus.
I suspected that the difference between "strong happens before" and
"happens before" is somehow related to implied ordering due to
causality. After reading the text above my feeling changed from
suspicion to strong suspicion. But it is not yet a certainty.
Note that "A is sequenced before D" would be sufficient to ensure that
both "A happens before D" and "A strongly happens before D" are true.
The difference between the two terms only shows up if A is not sequenced before D. In that case, at a minimum you must have "A inter-thread
happens before D", but is not synchronized with D.
For instance A inter-thread happens before D if it is dependency-ordered before D. (6.9.2.1p9). This could happen if A performs a release
operation on an atomic object M , and, in another thread, D performs a consume operation on M and reads the value written by A (6.9.2.1p8).
"An evaluation A strongly happens before an evaluation D if, either:
(12.4)— there is an evaluation B such that A strongly happens before B,
and B strongly happens before D.
Do you need an explanation of the parts of the above explanation that
use the terms "release" and "consume"? I have little experience with >multi-threaded code - someone else might be able to explain those better
than I can.
On Tue, 1 Apr 2025 13:55:43 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:
On 4/1/25 00:29, Jakob Bohm wrote:
However treating the standard text as an imperfect description of
traditional compiler techniques used for 2nd. Edition compilers
makes much more sense .
No, that does not. The standard was never intended as a description of
how compilers actually work, it was always intended to be a
description of requirements on how they should work.
It sounds to me like a revisionisms.
Most language standards are intended to codify commonalities of work of existing compilers. That applies to C++98 and mostly, although not completely, to the following C++ standards.
There exist exceptions, for example, Ada83. But they are exceptions.
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 14 |
Nodes: | 8 (0 / 8) |
Uptime: | 61:42:07 |
Calls: | 178 |
Files: | 21,502 |
Messages: | 79,431 |