Re: Pre-main construction order in modules

Liste des GroupesRevenir à cl c++ 
Sujet : Re: Pre-main construction order in modules
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.c++
Date : 01. Apr 2025, 21:26:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250401232600.00002eb6@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
On Tue, 1 Apr 2025 14:32:54 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wrote:

On 01.04.2025 10:26, Muttley@DastardlyHQ.org wrote:
On Mon, 31 Mar 2025 19:42:48 -0400
James Kuyper <jameskuyper@alumni.caltech.edu> wibbled: 
On 31.03.2025 17:01, Muttley@DastardlyHQ.org wrote: 
On Mon, 31 Mar 2025 15:39:53 +0300
Paavo Helde <eesnimi@osa.pri.ee> wibbled: 
On 31.03.2025 12:09, Muttley@DastardlyHQ.org wrote:
"If [initialization] is deferred, it strongly happens before any
non-initialization odr-use of any non-inline function or
non-inline variable defined in the same translation unit as the
variable to be initialized." 
>
Who writes this stuff? Its borderline gibberish. 
>
Keep in mind that the key thing that makes this seem like
gibberish is the use of precisely defined technical jargon, which
is used for the same reason that jargon is used in many other
contexts: it has a more precisely specified meaning than more
informal wording would have had.
>
Key pieces of jargon: "strongly happens before",
"non-initialization", 
 
"strongly happens before" is genuine gibberish. Either something
happens before or it doesn't, the adverb is entirely superfluous. 
 
Terms are explicitly defined by the C++ standard precisely because
their meaning cannot be inferred by using ordinary English to
interpret the words that make them up. Both "happens before" and
"strongly happens before" are separate pieces of C++ jargon, and the
requirements for qualifying as "strongly happens before" are in fact
stronger than those for "happens before".
 
"An evaluation A happens before an evaluation B (or, equivalently, B
happens after A) if:
(10.1)— A is sequenced before B, or
(10.2)— A inter-thread happens before B.
The implementation shall ensure that no program execution
demonstrates a cycle in the “happens before” relation. [Note: This
cycle would otherwise be possible only through the use of consume
operations. — end note]" (6.9.2.1p10).
 
the first occurrence of "happens before" in that clause is in italics,
an ISO convention indicating that it is a piece of specialized jargon
whose definition is provided by the sentence in which it occurs. Note
that "sequenced before" and "inter-thread happens before" are two
other pieces of standard-defined jargon.
 
"An evaluation A strongly happens before an evaluation D if, either
(12.1)— A is sequenced before D, or
(12.2)— A synchronizes with D, and both A and D are sequentially
consistent atomic operations (31.4), or
(12.3)— there are evaluations B and C such that A is sequenced before
B, B simply happens before C, and C is sequenced before D, or
(12.4)— there is an evaluation B such that A strongly happens before
B, and B strongly happens before D.
[Note: Informally, if A strongly happens before B, then A appears to
be evaluated before B in all contexts. Strongly happens before
excludes consume operations. — end note]"
 
The first occurrence of "strongly happens before" in that clause is
also italicized.
 
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).
 
In that case, the requirements associated with "A happens before D"
must be met, but those associated with "A strongly happens before D"
need not be.
 

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.

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.
 

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.







Date Sujet#  Auteur
30 Mar 25 * Pre-main construction order in modules67Muttley
30 Mar 25 +* Re: Pre-main construction order in modules2Richard Damon
30 Mar 25 i`- Re: Pre-main construction order in modules1Bonita Montero
30 Mar 25 `* Re: Pre-main construction order in modules64James Kuyper
30 Mar 25  `* Re: Pre-main construction order in modules63Muttley
30 Mar 25   +* Re: Pre-main construction order in modules30Muttley
30 Mar 25   i+* Re: Pre-main construction order in modules14Muttley
30 Mar 25   ii+- Re: Pre-main construction order in modules1Richard Damon
31 Mar 25   ii+- Re: Pre-main construction order in modules1Muttley
31 Mar 25   ii`* Re: Pre-main construction order in modules11Bonita Montero
31 Mar 25   ii +* Re: Pre-main construction order in modules9Paavo Helde
31 Mar 25   ii i`* Re: Pre-main construction order in modules8Bonita Montero
31 Mar 25   ii i +- Re: Pre-main construction order in modules1Richard Damon
31 Mar 25   ii i `* Re: Pre-main construction order in modules6Paavo Helde
31 Mar 25   ii i  `* Re: Pre-main construction order in modules5Bonita Montero
31 Mar 25   ii i   +- Re: Pre-main construction order in modules1Paavo Helde
1 Apr 25   ii i   `* Re: Pre-main construction order in modules3Jakob Bohm
1 Apr 25   ii i    +- Re: Pre-main construction order in modules1Bonita Montero
1 Apr 25   ii i    `- Re: Pre-main construction order in modules1Paavo Helde
31 Mar 25   ii `- Re: Pre-main construction order in modules1Richard Damon
30 Mar 25   i`* Re: Pre-main construction order in modules15Bonita Montero
30 Mar 25   i `* Re: Pre-main construction order in modules14Bonita Montero
30 Mar 25   i  `* Re: Pre-main construction order in modules13Bonita Montero
30 Mar 25   i   `* Re: Pre-main construction order in modules12Bonita Montero
30 Mar 25   i    +- Re: Pre-main construction order in modules1Richard Damon
30 Mar 25   i    `* Re: Pre-main construction order in modules10Bonita Montero
30 Mar 25   i     `* Re: Pre-main construction order in modules9Chris M. Thomasson
31 Mar 25   i      `* Re: Pre-main construction order in modules8Bonita Montero
1 Apr 25   i       `* Re: Pre-main construction order in modules7Chris M. Thomasson
1 Apr 25   i        `* Re: Pre-main construction order in modules6Bonita Montero
1 Apr 25   i         `* Re: Pre-main construction order in modules5Chris M. Thomasson
1 Apr 25   i          `* Re: Pre-main construction order in modules4Bonita Montero
1 Apr 25   i           `* Re: Pre-main construction order in modules3Fred. Zwarts
1 Apr 25   i            `* Re: Pre-main construction order in modules2Bonita Montero
1 Apr 25   i             `- Re: Pre-main construction order in modules1Bonita Montero
31 Mar 25   +* Re: Pre-main construction order in modules25Paavo Helde
31 Mar 25   i+* Re: Pre-main construction order in modules23Muttley
31 Mar 25   ii`* Re: Pre-main construction order in modules22Paavo Helde
31 Mar 25   ii `* Re: Pre-main construction order in modules21Muttley
31 Mar 25   ii  +- Re: Pre-main construction order in modules1Paavo Helde
1 Apr 25   ii  `* Re: Pre-main construction order in modules19James Kuyper
1 Apr 25   ii   `* Re: Pre-main construction order in modules18Muttley
1 Apr 25   ii    +* Re: Pre-main construction order in modules11Paavo Helde
1 Apr 25   ii    i+* Re: Pre-main construction order in modules6Muttley
1 Apr 25   ii    ii`* Re: Pre-main construction order in modules5Paavo Helde
1 Apr 25   ii    ii +- Re: Pre-main construction order in modules1Muttley
1 Apr 25   ii    ii `* Re: Pre-main construction order in modules3Michael S
1 Apr 25   ii    ii  +- Re: Pre-main construction order in modules1Muttley
1 Apr 25   ii    ii  `- Re: Pre-main construction order in modules1Muttley
1 Apr 25   ii    i`* Re: Pre-main construction order in modules4Michael S
1 Apr 25   ii    i +* Re: Pre-main construction order in modules2Paavo Helde
1 Apr 25   ii    i i`- Re: Pre-main construction order in modules1Muttley
1 Apr 25   ii    i `- Re: Pre-main construction order in modules1James Kuyper
1 Apr 25   ii    `* Re: Pre-main construction order in modules6James Kuyper
1 Apr 25   ii     +- Re: Pre-main construction order in modules1Chris M. Thomasson
1 Apr 25   ii     +* Re: Pre-main construction order in modules2Michael S
2 Apr 25   ii     i`- Re: Pre-main construction order in modules1James Kuyper
2 Apr 25   ii     +- Re: Pre-main construction order in modules1James Kuyper
2 Apr 25   ii     `- Re: Pre-main construction order in modules1Muttley
31 Mar 25   i`- Re: Pre-main construction order in modules1Bonita Montero
31 Mar 25   `* Re: Pre-main construction order in modules7James Kuyper
1 Apr 25    `* Re: Pre-main construction order in modules6Jakob Bohm
1 Apr 25     `* Re: Pre-main construction order in modules5James Kuyper
1 Apr 25      `* Re: Pre-main construction order in modules4Michael S
1 Apr 25       +- Re: Pre-main construction order in modules1Keith Thompson
1 Apr 25       +- Re: Pre-main construction order in modules1James Kuyper
2 Apr 25       `- Re: Pre-main construction order in modules1David Brown

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal