Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions source/exec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -498,13 +498,13 @@
struct default_domain;

// \ref{exec.sched}, schedulers
struct @\libglobal{scheduler_t}@ {};
struct @\libglobal{scheduler_tag}@ {};

template<class Sch>
concept @\libconcept{scheduler}@ = @\seebelow@;

// \ref{exec.recv}, receivers
struct @\libglobal{receiver_t}@ {};
struct @\libglobal{receiver_tag}@ {};

template<class Rcvr>
concept @\libconcept{receiver}@ = @\seebelow@;
Expand All @@ -524,7 +524,7 @@
inline constexpr set_stopped_t @\libglobal{set_stopped}@{};

// \ref{exec.opstate}, operation states
struct @\libglobal{operation_state_t}@ {};
struct @\libglobal{operation_state_tag}@ {};

template<class O>
concept @\libconcept{operation_state}@ = @\seebelow@;
Expand All @@ -533,7 +533,7 @@
inline constexpr start_t @\libglobal{start}@{};

// \ref{exec.snd}, senders
struct @\libglobal{sender_t}@ {};
struct @\libglobal{sender_tag}@ {};

template<class Sndr>
inline constexpr bool enable_sender = @\seebelow@;
Expand Down Expand Up @@ -756,8 +756,8 @@
class @\libglobal{parallel_scheduler}@;
parallel_scheduler get_parallel_scheduler();

// \ref{exec.sysctxrepl}, namespace \tcode{system_context_replaceability}
namespace @\libglobal{system_context_replaceability}@ {
// \ref{exec.parschedrepl}, namespace \tcode{parallel_scheduler_replacement}
namespace @\libglobal{parallel_scheduler_replacement}@ {
struct receiver_proxy;
struct bulk_item_receiver_proxy;
struct parallel_scheduler_backend;
Expand Down Expand Up @@ -1265,7 +1265,7 @@
namespace std::execution {
template<class Sch>
concept @\deflibconcept{scheduler}@ =
@\libconcept{derived_from}@<typename remove_cvref_t<Sch>::scheduler_concept, scheduler_t> &&
@\libconcept{derived_from}@<typename remove_cvref_t<Sch>::scheduler_concept, scheduler_tag> &&
@\exposconcept{queryable}@<Sch> &&
requires(Sch&& sch) {
{ schedule(std::forward<Sch>(sch)) } -> @\libconcept{sender}@;
Expand Down Expand Up @@ -1367,7 +1367,7 @@
namespace std::execution {
template<class Rcvr>
concept @\deflibconcept{receiver}@ =
@\libconcept{derived_from}@<typename remove_cvref_t<Rcvr>::receiver_concept, receiver_t> &&
@\libconcept{derived_from}@<typename remove_cvref_t<Rcvr>::receiver_concept, receiver_tag> &&
requires(const remove_cvref_t<Rcvr>& rcvr) {
{ get_env(rcvr) } -> @\exposconcept{queryable}@;
} &&
Expand Down Expand Up @@ -1562,7 +1562,7 @@
namespace std::execution {
template<class O>
concept @\deflibconcept{operation_state}@ =
@\libconcept{derived_from}@<typename O::operation_state_concept, operation_state_t> &&
@\libconcept{derived_from}@<typename O::operation_state_concept, operation_state_tag> &&
requires (O& o) {
start(o);
};
Expand Down Expand Up @@ -2069,7 +2069,7 @@
template<class Sndr, class Rcvr, class Index>
requires @\exposconcept{valid-specialization}@<@\exposid{env-type}@, Index, Sndr, Rcvr>
struct @\exposidnc{basic-receiver}@ { // \expos
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;

using @\exposidnc{tag-t}@ = tag_of_t<Sndr>; // \expos
using @\exposidnc{state-t}@ = @\exposidnc{state-type}@<Sndr, Rcvr>; // \expos
Expand Down Expand Up @@ -2141,7 +2141,7 @@
requires @\exposconcept{valid-specialization}@<@\exposid{state-type}@, Sndr, Rcvr> &&
@\exposconcept{valid-specialization}@<@\exposid{connect-all-result}@, Sndr, Rcvr>
struct @\exposidnc{basic-operation}@ : @\exposidnc{basic-state}@<Sndr, Rcvr> { // \expos
using operation_state_concept = operation_state_t;
using operation_state_concept = operation_state_tag;
using @\exposidnc{tag-t}@ = tag_of_t<Sndr>; // \expos

@\exposidnc{connect-all-result}@<Sndr, Rcvr> @\exposidnc{inner-ops}@; // \expos
Expand Down Expand Up @@ -2265,7 +2265,7 @@
namespace std::execution {
template<class Tag, class Data, class... Child>
struct @\exposidnc{basic-sender}@ : @\exposidnc{product-type}@<Tag, Data, Child...> { // \expos
using sender_concept = sender_t;
using sender_concept = sender_tag;
using @\exposidnc{indices-for}@ = index_sequence_for<Child...>; // \expos

decltype(auto) get_env() const noexcept {
Expand Down Expand Up @@ -2360,7 +2360,7 @@
%%FIXME: Should this be in a namespace?
\begin{codeblock}
struct @\exposid{not-a-sender}@ {
using sender_concept = sender_t;
using sender_concept = sender_tag;

template<class Sndr>
static consteval auto get_completion_signatures() -> completion_signatures<> {
Expand All @@ -2374,7 +2374,7 @@
\indexlibrarymember{schedule}{\exposid{not-a-sender}}%
\begin{codeblock}
struct @\exposid{not-a-scheduler}@ {
using scheduler_concept = scheduler_t;
using scheduler_concept = scheduler_tag;

constexpr auto schedule() const noexcept {
return @\exposid{not-a-sender}@();
Expand Down Expand Up @@ -2493,7 +2493,7 @@

template<class Sndr>
concept @\defexposconcept{is-sender}@ = // \expos
@\libconcept{derived_from}@<typename Sndr::sender_concept, sender_t>;
@\libconcept{derived_from}@<typename Sndr::sender_concept, sender_tag>;

template<class Sndr>
concept @\defexposconcept{enable-sender}@ = // \expos
Expand Down Expand Up @@ -3154,7 +3154,7 @@
\begin{codeblock}
namespace std::execution {
struct @\exposid{operation-state-task}@ { // \expos
using operation_state_concept = operation_state_t;
using operation_state_concept = operation_state_tag;
using promise_type = @\exposid{connect-awaitable-promise}@;

explicit @\exposid{operation-state-task}@(coroutine_handle<> h) noexcept : coro(h) {}
Expand Down Expand Up @@ -3766,7 +3766,7 @@
\begin{codeblock}
namespace std::execution {
struct @\exposid{receiver-type}@ {
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;
@\exposid{state-type}@* @\exposid{state}@; // \expos

void set_value() && noexcept {
Expand Down Expand Up @@ -4174,7 +4174,7 @@
namespace std::execution {
template<class Rcvr, class Env>
struct @\exposid{receiver2}@ {
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;

template<class... Args>
void set_value(Args&&... args) && noexcept {
Expand Down Expand Up @@ -4295,7 +4295,7 @@
@\exposid{let-state}@& state; // \expos
Rcvr& @\exposid{rcvr}@; // \expos

using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;

template<class... Args>
constexpr void set_value(Args&&... args) noexcept {
Expand Down Expand Up @@ -5584,7 +5584,7 @@
namespace std::execution {
template<class Completions>
struct @\exposid{spawn-future-receiver}@ { // \expos
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;

@\exposid{spawn-future-state-base}@<Completions>* @\exposid{state}@; // \expos

Expand Down Expand Up @@ -5858,7 +5858,7 @@
stop_callback_for_t<@\exposid{stop-token-t}@, @\exposid{callback}@>;

struct @\exposid{rcvr-t}@ { // \expos
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;
@\exposid{future-operation}@* @\exposid{op}@; // \expos

template<class... T>
Expand Down Expand Up @@ -6091,7 +6091,7 @@

template<class Sndr>
struct @\exposid{sync-wait-receiver}@ { // \expos
using receiver_concept = execution::receiver_t;
using receiver_concept = execution::receiver_tag;
@\exposidnc{sync-wait-state}@<Sndr>* @\exposid{state}@; // \expos

template<class... Args>
Expand Down Expand Up @@ -6301,7 +6301,7 @@
\begin{codeblock}
namespace std::execution {
struct @\exposid{spawn-receiver}@ { // \expos
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;

@\exposid{spawn-state-base}@* @\exposid{state}@; // \expos
void set_value() && noexcept { @\exposid{state}@->@\exposid{complete}@(); }
Expand Down Expand Up @@ -6435,7 +6435,7 @@
\begin{example}
\begin{codeblock}
struct my_sender {
using sender_concept = sender_t;
using sender_concept = sender_tag;
using completion_signatures =
execution::completion_signatures<
set_value_t(),
Expand Down Expand Up @@ -7075,7 +7075,7 @@
\exposid{awaitable-receiver} is equivalent to:
\begin{codeblock}
struct @\exposid{awaitable-receiver}@ {
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;
variant<monostate, @\exposidnc{result-type}@, exception_ptr>* @\exposidnc{result-ptr}@; // \expos
coroutine_handle<Promise> @\exposidnc{continuation}@; // \expos
// \seebelow
Expand Down Expand Up @@ -7395,7 +7395,7 @@
class @\exposidnc{inline-state}@; // \expos

public:
using scheduler_concept = scheduler_t;
using scheduler_concept = scheduler_tag;

constexpr @\exposid{inline-sender}@ schedule() noexcept { return {}; }
constexpr bool operator==(const inline_scheduler&) const noexcept = default;
Expand Down Expand Up @@ -7453,7 +7453,7 @@
class @\exposid{backend-for}@; // \expos

public:
using scheduler_concept = scheduler_t;
using scheduler_concept = scheduler_tag;

template<class Sch, class Allocator = allocator<void>>
requires (!@\libconcept{same_as}@<task_scheduler, remove_cvref_t<Sch>>) && @\libconcept{scheduler}@<Sch>
Expand All @@ -7470,8 +7470,8 @@
friend bool operator==(const task_scheduler& lhs, const Sch& rhs) noexcept;

private:
// see \ref{exec.sysctxrepl.psb}
shared_ptr<system_context_replaceability::parallel_scheduler_backend> @\exposidnc{sch_}@; // \expos
// see \ref{exec.parschedrepl.psb}
shared_ptr<parallel_scheduler_replacement::parallel_scheduler_backend> @\exposidnc{sch_}@; // \expos
};
}
\end{codeblock}
Expand Down Expand Up @@ -7550,7 +7550,7 @@
namespace std::execution {
template<@\libconcept{scheduler}@ Sch>
class task_scheduler::@\exposid{backend-for}@
: public system_context_replaceability::parallel_scheduler_backend { // \expos
: public parallel_scheduler_replacement::parallel_scheduler_backend { // \expos
public:
explicit @\exposid{backend-for}@(Sch sch) : @\exposid{sched_}@(std::move(sch)) {}

Expand Down Expand Up @@ -7648,7 +7648,7 @@
\begin{itemize}
\item
\tcode{r} is a proxy for \tcode{rcvr} with base
\tcode{system_context_replaceability::receiver_proxy}\iref{exec.par.scheduler}
\tcode{parallel_scheduler_replacement::receiver_proxy}\iref{exec.par.scheduler}
and
\item
\tcode{s} is a preallocated backend storage for \tcode{r}.
Expand Down Expand Up @@ -7767,7 +7767,7 @@
class @\exposidnc{state}@; // \expos

public:
using sender_concept = sender_t;
using sender_concept = sender_tag;
using allocator_type = @\seebelow@;
using start_scheduler_type = @\seebelow@;
using stop_source_type = @\seebelow@;
Expand Down Expand Up @@ -7915,7 +7915,7 @@
template<@\libconcept{receiver}@ Rcvr>
class task<T, Environment>::@\exposidnc{state}@ { // \expos
public:
using operation_state_concept = operation_state_t;
using operation_state_concept = operation_state_tag;

template<class R>
@\exposid{state}@(coroutine_handle<promise_type> h, R&& rr);
Expand Down Expand Up @@ -8530,7 +8530,7 @@
template<class Scope, class Rcvr>
struct @\exposid{state}@ { // \expos
struct @\exposid{rcvr-t}@ { // \expos
using receiver_concept = receiver_t;
using receiver_concept = receiver_tag;

Rcvr& @\exposid{rcvr}@; // \expos

Expand Down Expand Up @@ -9057,7 +9057,7 @@
\begin{itemize}
\item
\tcode{r} is a proxy for \tcode{rcvr}
with base \tcode{system_context_replaceability::receiver_proxy} and
with base \tcode{parallel_scheduler_replacement::receiver_proxy} and
\item
\tcode{s} is a preallocated backend storage for \tcode{r}.
\end{itemize}
Expand Down Expand Up @@ -9120,7 +9120,7 @@
\begin{itemize}
\item
\tcode{r} is a proxy for \tcode{rcvr}
with base \tcode{system_context_replaceability::bulk_item_receiver_proxy}
with base \tcode{parallel_scheduler_replacement::bulk_item_receiver_proxy}
such that \tcode{r.execute(i, j)} for indices \tcode{i} and \tcode{j}
has effects equivalent to
\tcode{f(i, j, args...)} if \tcode{p} is true and
Expand All @@ -9145,7 +9145,7 @@
\begin{itemize}
\item
\tcode{r} is a proxy for \tcode{rcvr}
with base \tcode{system_context_replaceability::bulk_item_receiver_proxy}
with base \tcode{parallel_scheduler_replacement::bulk_item_receiver_proxy}
such that \tcode{r.execute(i, i + 1)} for index \tcode{i}
has effects equivalent to
\tcode{f(i, args...)} if \tcode{p} is true and
Expand All @@ -9168,25 +9168,25 @@
\begin{itemdescr}
\pnum
\effects
Let \tcode{eb} be the result of \tcode{system_context_replaceability::query_parallel_scheduler_backend()}.
Let \tcode{eb} be the result of \tcode{parallel_scheduler_replacement::query_parallel_scheduler_backend()}.
If \tcode{eb == nullptr} is \tcode{true},
calls \tcode{terminate}\iref{except.terminate}.
Otherwise, returns a \tcode{parallel_scheduler} object
associated with \tcode{eb}.
\end{itemdescr}

\rSec1[exec.sysctxrepl]{Namespace \tcode{system_context_replaceability}}
\rSec1[exec.parschedrepl]{Namespace \tcode{parallel_scheduler_replacement}}

\rSec2[exec.sysctxrepl.general]{General}
\rSec2[exec.parschedrepl.general]{General}

\pnum
Facilities in the \tcode{system_context_replaceability} namespace
Facilities in the \tcode{parallel_scheduler_replacement} namespace
allow users to replace the default implementation of \tcode{parallel_scheduler}.

\rSec2[exec.sysctxrepl.recvproxy]{Receiver proxies}
\rSec2[exec.parschedrepl.recvproxy]{Receiver proxies}

\begin{codeblock}
namespace std::execution::system_context_replaceability {
namespace std::execution::parallel_scheduler_replacement {
struct @\libglobal{receiver_proxy}@ {
protected:
virtual bool @\exposidnc{query-env}@(@\unspecnc@) noexcept = 0; // \expos
Expand Down Expand Up @@ -9270,7 +9270,7 @@
all calls to \tcode{try_query} return equivalent \tcode{inplace_stop_token} objects.
\end{itemdescr}

\rSec2[exec.sysctxrepl.query]{\tcode{query_parallel_scheduler_backend}}
\rSec2[exec.parschedrepl.query]{\tcode{query_parallel_scheduler_backend}}

\indexlibraryglobal{query_parallel_scheduler_backend}%
\begin{itemdecl}
Expand All @@ -9297,10 +9297,10 @@
This function is replaceable\iref{term.replaceable.function}.
\end{itemdescr}

\rSec2[exec.sysctxrepl.psb]{Class \tcode{parallel_scheduler_backend}}
\rSec2[exec.parschedrepl.psb]{Class \tcode{parallel_scheduler_backend}}

\begin{codeblock}
namespace std::execution::system_context_replaceability {
namespace std::execution::parallel_scheduler_replacement {
struct @\libglobal{parallel_scheduler_backend}@ {
virtual ~parallel_scheduler_backend() = default;

Expand Down
Loading