Sujet : Re: Pre-main construction order in modules
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.lang.c++Date : 02. Apr 2025, 03:55:56
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vsi8vs$k7j9$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 4/1/25 14:32, James Kuyper wrote:
...
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).
I got sidetracked by life before I could look into that further, but
I've traced down relevant text in 1.10p7: "An evaluation A that performs
a release operation on an object M synchronizes with an evaluation B
that performs an acquire operation on M and reads a value written by any
side effect in the release sequence headed by A."
Therefore, A "happens before" D, but does not "strongly happen before" D
if A does a release on M, and D does a consume on M, but D does not do
an acquire on M followed by reading a value written by a side effect of
A's release sequence.