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 { template<class Sch> concept scheduler = derived_from<typename remove_cvref_t<Sch>::scheduler_concept, scheduler_t> && queryable<Sch> && requires(Sch&& sch) { { schedule(std::forward<Sch>(sch)) } -> sender; { auto(get_completion_scheduler<set_value_t>( get_env(schedule(std::forward<Sch>(sch))))) } -> same_as<remove_cvref_t<Sch>>; } && equality_comparable<remove_cvref_t<Sch>> && copy_constructible<remove_cvref_t<Sch>>; }
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<Sch>, Env> is satisfied.
Then sender-in-of<schedule_result_t<Sch>, Env> shall be modeled.
None of a scheduler's copy constructor, destructor, equality comparison, or swap member functions shall exit via an exception.
None of these member functions, nor a scheduler type's schedule function, shall introduce data races as a result of potentially concurrent ([intro.races]) invocations of those functions 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 expression get_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]