This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.
Section: 32.5.4 [atomics.order] Status: New Submitter: jim x Opened: 2026-02-10 Last modified: 2026-02-14
Priority: Not Prioritized
View other active issues in [atomics.order].
View all other issues in [atomics.order].
View all issues with New status.
Discussion:
32.5.4 [atomics.order] p10 says:
Atomic read-modify-write operations shall always read the last value (in the modification order) written before the write associated with the read-modify-write operation.
We do not write side effects to the modification order, instead we write side effects to an atomic object. These modifications occur in a single total order, called the modification order. That is, the modification order describes how these operations are ordered.
Moreover, we called the compared element in the modification order "modification" or "side effect", as shown in 6.10.2.2 [intro.races]. In addition, we don't use "a side effectX
written before Y in the modification order"; we use "X precedes/follows
Y in the modification order" to describe the relationship of order between two modifications.
Suggested Resolution:
To make the wording more formal and have a consistent way with 6.10.2.2 [intro.races], the proposed wording is:
An atomic read-modify-write operation shall always read the value of a side effect
X, whereXis the last side effect that precedes the side effect of the read-modify-write operation in the modification order.
Another option is:
An atomic read-modify-write operation shall always read the value of a side effect that immediately precedes the side effect of the read-modify-write operation in the modification order.
Proposed resolution:
This wording is relative to N5032.
[Drafting Note: Two mutually exclusive options are prepared, depicted below by Option A and Option B, respectively.]
Option A:
Modify 32.5.4 [atomics.order] as indicated:
-10- An atomic read-modify-write operation
sshall always read thelastvalue of a side effectX, whereXis the last side effect that precedes the side effect of the read-modify-write operation(in the modification order) written before the write associated with the read-modify-write operation.
Option B:
Modify 32.5.4 [atomics.order] as indicated:
-10- An atomic read-modify-write operation
sshall always read thelastvalue of a side effect that immediately precedes the side effect of the read-modify-write operation(in the modification order) written before the write associated with the read-modify-write operation.