This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of WP status.

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

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

Priority: Not Prioritized

View all other issues in [exec.sched].

View all issues with WP 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]).

[2025-10-23; Reflector poll.]

Set status to Tentatively Ready after six votes in favour during reflector poll.

"What is this telling me as a user? That a custom execution resource can add a non-standard 'wait for completion' facility?"

[Kona 2025-11-08; Status changed: Voting → WP.]

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]