|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4328" status="New"> |
| 5 | +<title>Remove note in §[exec.sched] regarding waiting for completion of scheduled operations</title> |
| 6 | +<section> |
| 7 | +<sref ref="[exec.sched]"/> |
| 8 | +</section> |
| 9 | +<submitter>Lewis Baker</submitter> |
| 10 | +<date>25 Aug 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +The note at the end of <sref ref="[exec.sched]"/> says: |
| 16 | +</p> |
| 17 | +<blockquote><p> |
| 18 | +[<i>Note</i>: The ability to wait for completion of submitted function objects can be provided by the |
| 19 | +associated execution resource of the scheduler — <i>end note</i>] |
| 20 | +</p></blockquote> |
| 21 | +<p> |
| 22 | +The suggestion that the execution resource should be used to join/wait on scheduled work is problematic |
| 23 | +in situations that may involve more than one execution context, as an execution resource having an empty |
| 24 | +queue of scheduled work does not necessarily imply that tasks currently running on another execution |
| 25 | +context will not later schedule additional work on this execution resource. |
| 26 | +<p/> |
| 27 | +With the introduction of `counting_scope` with <paper num="P3149"/> we now have a better recommended |
| 28 | +way of waiting for tasks that use a resource (including execution resources) to complete. |
| 29 | +<p/> |
| 30 | +The note as it stands represents bad guidance and should either be removed or updated to refer to |
| 31 | +`counting_scope` and `simple_counting_scope` (<sref ref="[exec.counting.scopes]"/>). |
| 32 | +</p> |
| 33 | +</discussion> |
| 34 | + |
| 35 | +<resolution> |
| 36 | +<p> |
| 37 | +This wording is relative to <paper num="N5014"/>. |
| 38 | +</p> |
| 39 | + |
| 40 | +<ol> |
| 41 | + |
| 42 | +<li><p>Modify <sref ref="[exec.sched]"/> as indicated:</p> |
| 43 | + |
| 44 | +<blockquote> |
| 45 | +<p> |
| 46 | +-7- A scheduler type's destructor shall not block pending completion of any receivers connected to the sender |
| 47 | +objects returned from schedule. |
| 48 | +<p/> |
| 49 | +<del>[<i>Note 1</i>: The ability to wait for completion of submitted function objects can be provided by |
| 50 | +the associated execution resource of the scheduler. — <i>end note</i>]</del> |
| 51 | +</p> |
| 52 | +</blockquote> |
| 53 | + |
| 54 | +</li> |
| 55 | + |
| 56 | +</ol> |
| 57 | +</resolution> |
| 58 | + |
| 59 | +</issue> |
0 commit comments