[atomics.types.operations]/[atomics.wait] Clarify the behavior of `constexpr` atomic `wait()`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp
- Domain
- documentation
Research direction
Start by reading the [atomics.types.operations]/[atomics.wait] wording, the linked eel.is clauses, and WG21 paper P3309R3. Determine whether the standard should explicitly exclude atomic waiting operations from constant expressions and whether the listed wait APIs can be covered together; done means a reviewed, normative clarification or agreed rationale.
Written by the indexing model from the issue text.
Description
I find it very odd that https://eel.is/c++draft/atomics.types.operations#lib:wait,atomic doesn't specify what happens during constant evaluation.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html#wait argues that wait() during compile time would exceed implementation limits, but there is no implementation limit that's clearly exceeded here. Why shouldn't wait() be allowed to deadlock the compiler frontend? "system clock time" or "execution steps" are not limits in [implimits] after all, and even if were, that's not a normative index.
Perhaps an argument against deadlocking the frontend is that https://eel.is/c++draft/intro.progress#1 specifies that any thread (presumably including the compiler frontend thread for constant evaluation) will make progress eventually. Core language UB is not a constant expression, and that includes [intro], so I guess that makes the call to wait() immediately invalid.
A possible way to clarify it is to say that atomic waiting operations are not constant expressions (either normatively or as a note), to include atomic_flag_wait, atomic_wait, atomic::wait, atomic_ref::wait, etc. in one fell swoop.
- Dominant language
- TeX
- Stars
- 221
- Forks
- 813
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 34
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cplusplus/draft
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
ub-ifndr
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
P3-Other
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
area:dictation documentation P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
uttrflow/uttrflow-swift#1180 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
falcosecurity/falco-website#1601 ·
-
specification
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
WICG/webmonetization#729 ·