Open2

(Simply|Strongly)? Happens Before

yohhoyyohhoy

C++20以降のメモリモデル規定で重要な二項関係:

C++17では simply happens before 相当仕様が strongly happens before と呼ばれていた。C++20で名称変更。

yohhoyyohhoy

Paper

Repairing Sequential Consistency in C/C++11

Common Compiler Optimisations are Invalid in the C11 Memory Model and what we can do about it

WG21

P0668R5: Revising the C++ memory model

Summarizing, we continue to have, as we did before:

(plain) happens-before
  The fundamental relation used to reason about data races
strong happens before
  The ordering relation usually promised by libraries to ensure usability and composability in all contexts

The simply-happens-before relation is an atifact of our definition. In the absence of

  1. memory_order_consume, and
  2. mixed use of both acquire/release and seq_cst operations on the same location

all three definitions coincide.

LWG3941. §[atomics.order] inadvertently prohibits widespread implementation techniques
(https://wg21.cmeerw.net/lwg/issue3941)

The problem here is an error during the attempt to simplify and translate plv.mpi-sws.org/scfix/paper.pdf to standardese. There is no known issue with the underlying paper.

StackOverflow