Title
Improve [atomics.order] p10 to have a consistent way with [intro.races]
Status
open
Section
[atomics.order]
Submitter
jim x

Created on 2026-02-10.00:00:00 last changed 1 week ago

Messages

Date: 2026-02-27.16:05:19

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.

As a drive-by fix, in both options we also replace the "shall" wording by an indicative voice, because [atomics.order] p10 already imposes a requirement on the implementation/language. ]

Option A:

  1. Modify [atomics.order] as indicated:

    -10- An atomic read-modify-write operations shall always reads the last value from the side effect X, where X is 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:

  1. Modify [atomics.order] as indicated:

    -10- An atomic read-modify-write operations shall always reads the last value from the 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.

Date: 2026-02-15.00:00:00

[ 2026-02-27; Reflector poll. ]

Set priority to 4 after reflector poll.

The existing wording was considered to be correct. Support for option B as wording improvement was expressed, as making the wording more formal and "de-shalling".

Date: 2026-02-10.00:00:00

[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 [intro.races]. In addition, we don't use "a side effect X 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 [intro.races], the proposed wording is:

An atomic read-modify-write operation shall always read the value of a side effect X, where X is 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.

History
Date User Action Args
2026-02-27 16:05:19adminsetmessages: + msg15980
2026-02-27 16:05:19adminsetstatus: new -> open
2026-02-14 14:21:59adminsetmessages: + msg15928
2026-02-10 00:00:00admincreate