tmp/tmp44w2nht1/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Schedulers <a id="exec.sched">[[exec.sched]]</a>
|
| 2 |
+
|
| 3 |
+
The `scheduler` concept defines the requirements of a scheduler type
|
| 4 |
+
[[exec.async.ops]]. `schedule` is a customization point object that
|
| 5 |
+
accepts a scheduler. A valid invocation of `schedule` is a
|
| 6 |
+
schedule-expression.
|
| 7 |
+
|
| 8 |
+
``` cpp
|
| 9 |
+
namespace std::execution {
|
| 10 |
+
template<class Sch>
|
| 11 |
+
concept scheduler =
|
| 12 |
+
derived_from<typename remove_cvref_t<Sch>::scheduler_concept, scheduler_t> &&
|
| 13 |
+
queryable<Sch> &&
|
| 14 |
+
requires(Sch&& sch) {
|
| 15 |
+
{ schedule(std::forward<Sch>(sch)) } -> sender;
|
| 16 |
+
{ auto(get_completion_scheduler<set_value_t>(
|
| 17 |
+
get_env(schedule(std::forward<Sch>(sch))))) }
|
| 18 |
+
-> same_as<remove_cvref_t<Sch>>;
|
| 19 |
+
} &&
|
| 20 |
+
equality_comparable<remove_cvref_t<Sch>> &&
|
| 21 |
+
copyable<remove_cvref_t<Sch>>;
|
| 22 |
+
}
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
Let `Sch` be the type of a scheduler and let `Env` be the type of an
|
| 26 |
+
execution environment for which `sender_in<schedule_result_t<Sch>, Env>`
|
| 27 |
+
is satisfied. Then `sender-in-of<schedule_result_t<Sch>, Env>` shall be
|
| 28 |
+
modeled.
|
| 29 |
+
|
| 30 |
+
No operation required by `copyable<remove_cvref_t<Sch>>` and
|
| 31 |
+
`equality_comparable<remove_cvref_t<Sch>>` shall exit via an exception.
|
| 32 |
+
None of these operations, nor a scheduler type’s `schedule` function,
|
| 33 |
+
shall introduce data races as a result of potentially concurrent
|
| 34 |
+
[[intro.races]] invocations of those operations from different threads.
|
| 35 |
+
|
| 36 |
+
For any two values `sch1` and `sch2` of some scheduler type `Sch`,
|
| 37 |
+
`sch1 == sch2` shall return `true` only if both `sch1` and `sch2` share
|
| 38 |
+
the same associated execution resource.
|
| 39 |
+
|
| 40 |
+
For a given scheduler expression `sch`, the expression
|
| 41 |
+
`get_completion_scheduler<set_value_t>(get_env(schedule(sch)))` shall
|
| 42 |
+
compare equal to `sch`.
|
| 43 |
+
|
| 44 |
+
For a given scheduler expression `sch`, if the expression
|
| 45 |
+
`get_domain(sch)` is well-formed, then the expression
|
| 46 |
+
`get_domain(get_env(schedule(sch)))` is also well-formed and has the
|
| 47 |
+
same type.
|
| 48 |
+
|
| 49 |
+
A scheduler type’s destructor shall not block pending completion of any
|
| 50 |
+
receivers connected to the sender objects returned from `schedule`.
|
| 51 |
+
|
| 52 |
+
[*Note 1*: The ability to wait for completion of submitted function
|
| 53 |
+
objects can be provided by the associated execution resource of the
|
| 54 |
+
scheduler. — *end note*]
|
| 55 |
+
|