4.2 KiB
[exec.sched]
33 Execution control library [exec]
33.6 Schedulers [exec.sched]
The scheduler concept defines the requirements of a scheduler type ([exec.async.ops]).
schedule is a customization point object that accepts a scheduler.
A valid invocation of schedule is a schedule-expression.
namespace std::execution {templateconcept scheduler =derived_from<typename remove_cvref_t::scheduler_concept, scheduler_t> &&queryable &&requires(Sch&& sch) {{ schedule(std::forward(sch)) } -> sender; { auto(get_completion_scheduler<set_value_t>( get_env(schedule(std::forward(sch))))) }-> same_as<remove_cvref_t>; } &&equality_comparable<remove_cvref_t> &©able<remove_cvref_t>;}
Let Sch be the type of a scheduler and let Env be the type of an execution environment for which sender_in<schedule_result_t, Env> is satisfied.
Then sender-in-of<schedule_result_t, Env> shall be modeled.
No operation required bycopyable<remove_cvref_t> andequality_comparable<remove_cvref_t> shall exit via an exception.
None of these operations, nor a scheduler type's schedule function, shall introduce data races as a result of potentially concurrent ([intro.races]) invocations of those operations from different threads.
For any two values sch1 and sch2 of some scheduler type Sch,sch1 == sch2 shall return true only if both sch1 and sch2 share the same associated execution resource.
For a given scheduler expression sch, the expressionget_completion_scheduler<set_value_t>(get_env(schedule(sch))) shall compare equal to sch.
For a given scheduler expression sch, if the expression get_domain(sch) is well-formed, then the expression get_domain(get_env(schedule(sch))) is also well-formed and has the same type.
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]