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.

4328. Remove note in §[exec.sched] regarding waiting for completion of scheduled operations

Section: 33.6 [exec.sched] Status: New Submitter: Lewis Baker Opened: 2025-08-25 Last modified: 2025-08-27

Priority: Not Prioritized

View other active issues in [exec.sched].

View all other issues in [exec.sched].

View all issues with New status.

Discussion:

The note at the end of 33.6 [exec.sched] says:

[Note: The ability to wait for completion of submitted function objects can be provided by the associated execution resource of the scheduler — end note]

The suggestion that the execution resource should be used to join/wait on scheduled work is problematic in situations that may involve more than one execution context, as an execution resource having an empty queue of scheduled work does not necessarily imply that tasks currently running on another execution context will not later schedule additional work on this execution resource.

With the introduction of counting_scope with P3149 we now have a better recommended way of waiting for tasks that use a resource (including execution resources) to complete.

The note as it stands represents bad guidance and should either be removed or updated to refer to counting_scope and simple_counting_scope (33.14.2 [exec.counting.scopes]).

Proposed resolution:

This wording is relative to N5014.

  1. Modify 33.6 [exec.sched] as indicated:

    -7- A scheduler type's destructor shall not block pending completion of any receivers connected to the sender objects returned from schedule.

    [Note 1: The ability to wait for completion of submitted function objects can be provided by the associated execution resource of the scheduler. — end note]