Created on 2025-08-06.00:00:00 last changed 3 days ago
[ 2025-12-10 Status changed: Tentatively NAD → NAD. ]
[ 2025-10-23; Reflector poll; Status changed: New → Tentatively NAD. ]
The loads are both done within functions calls, so are at worst indeterminately sequenced. So we already say what the suggested resolution wants.
Consider this snippet code:
std::atomic<int> flag = {0};
std::atomic<int> turn = {0};
if(flag + turn){}
The loads of `flag` and `turn` as the operands of `+` are unsequenced according to [intro.execution] p10.
Except where noted, evaluations of operands of individual operators and of subexpressions of individual expressions are unsequenced.
However, [atomics.order] p4 says:
There is a single total order S on all `memory_order::seq_cst` operations, including fences, that satisfies the following constraints.
Then, it says that:
First, if A and B are `memory_order::seq_cst` operations and A strongly happens before B, then A precedes B in S.
According to the first sentence, the load of `flag` and the load of `turn` do have an order in the single total order S since they are both `memory_order::seq_cst` operations. However, since they are unsequenced, the second sentence does not apply to them. So, what's the order of them in S? Is the order of them in S unspecified?
Suggested Resolution: We may want to say the order of such operations is indeterminate in the single total order. That is, either A precedes B or B precedes A, but it is unspecified which.| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-12-10 23:00:58 | admin | set | messages: + msg15808 |
| 2025-10-23 11:14:55 | admin | set | messages: + msg15388 |
| 2025-10-23 11:14:55 | admin | set | status: new -> nad |
| 2025-08-06 00:00:00 | admin | create | |