This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


2923. Note about infinite loops and execution steps

Section: 6.9.2.3  [intro.progress]     Status: review     Submitter: Simon Cooksey     Date: 2024-08-12     Liaison: SG1

Given that certain infinite loops are no longer undefined behavior (see P2809R3 (Trivial infinite loops are not Undefined Behavior), adopted in March 2024), the note in 6.9.2.3 [intro.progress] paragraph 5 claiming there are no executions without eventual execution steps should be struck.

Proposed resolution (approved by CWG 2024-09-13):

Remove 6.9.2.3 [intro.progress] paragraph 5:

[Note 4: Because of this and the preceding requirement regarding what threads of execution have to perform eventually, it follows that no thread of execution can execute forever without an execution step occurring. —end note]

CWG 2024-11-19

The definition of "execution step" in 6.9.2.3 [intro.progress] paragraph 3 does not include the invocation of std::this_thread::yield. However, trivial infinite loops do nothing but yield, and are not undefined behavior. Therefore, the note is believed to be factually wrong. CWG seeks advice from SG1 for resolving the inconsistency, via paper issue #2139.