33 Execution control library [exec]

33.16 Namespace system_context_replaceability [exec.sysctxrepl]

33.16.2 query_parallel_scheduler_backend [exec.sysctxrepl.query]

shared_ptr<parallel_scheduler_backend> query_parallel_scheduler_backend();
query_parallel_scheduler_backend() returns the implementation object for a parallel scheduler.
Returns: A non-null shared pointer to an object that implements the parallel_scheduler_backend interface.
Remarks: This function is replaceable ([dcl.fct.def.replace]).
namespace std::execution::system_context_replaceability { struct receiver_proxy { virtual ~receiver_proxy() = default; protected: virtual bool query-env(unspecified) noexcept = 0; // exposition only public: virtual void set_value() noexcept = 0; virtual void set_error(exception_ptr) noexcept = 0; virtual void set_stopped() noexcept = 0; template<class P, class-type Query> optional<P> try_query(Query q) noexcept; }; struct bulk_item_receiver_proxy : receiver_proxy { virtual void execute(size_t, size_t) noexcept = 0; }; }
receiver_proxy represents a receiver that will be notified by the implementations of parallel_scheduler_backend to trigger the completion operations.
bulk_item_receiver_proxy is derived from receiver_proxy and is used for bulk_chunked and bulk_unchunked customizations that will also receive notifications from implementations of parallel_scheduler_backend corresponding to different iterations.
template<class P, class-type Query> optional<P> try_query(Query q) noexcept;
Mandates: P is a cv-unqualified non-array object type.
Returns: Let env be the environment of the receiver represented by *this.
If
  • Query is not a member of an implementation-defined set of supported queries; or
  • P is not a member of an implementation-defined set of supported result types for Query; or
  • the expression q(env) is not well-formed or does not have type cv P,
then returns nullopt.
Otherwise, returns q(env).
Remarks: get_stop_token_t is in the implementation-defined set of supported queries, and inplace_stop_token is a member of the implementation-defined set of supported result types for get_stop_token_t.