From Jason Turner

[exec.sysctxrepl]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpkghp6stk/{from.md → to.md} +305 -0
tmp/tmpkghp6stk/{from.md → to.md} RENAMED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Namespace `system_context_replaceability` <a id="exec.sysctxrepl">[[exec.sysctxrepl]]</a>
2
+
3
+ ### General <a id="exec.sysctxrepl.general">[[exec.sysctxrepl.general]]</a>
4
+
5
+ Facilities in the `system_context_replaceability` namespace allow users
6
+ to replace the default implementation of `parallel_scheduler`.
7
+
8
+ ### Receiver proxies <a id="exec.sysctxrepl.recvproxy">[[exec.sysctxrepl.recvproxy]]</a>
9
+
10
+ ``` cpp
11
+ namespace std::execution::system_context_replaceability {
12
+ struct receiver_proxy {
13
+ virtual ~receiver_proxy() = default;
14
+
15
+ protected:
16
+ virtual bool query-env(unspecified) noexcept = 0; // exposition only
17
+
18
+ public:
19
+ virtual void set_value() noexcept = 0;
20
+ virtual void set_error(exception_ptr) noexcept = 0;
21
+ virtual void set_stopped() noexcept = 0;
22
+
23
+ template<class P, class-type Query>
24
+ optional<P> try_query(Query q) noexcept;
25
+ };
26
+
27
+ struct bulk_item_receiver_proxy : receiver_proxy {
28
+ virtual void execute(size_t, size_t) noexcept = 0;
29
+ };
30
+ }
31
+ ```
32
+
33
+ `receiver_proxy` represents a receiver that will be notified by the
34
+ implementations of `parallel_scheduler_backend` to trigger the
35
+ completion operations. `bulk_item_receiver_proxy` is derived from
36
+ `receiver_proxy` and is used for `bulk_chunked` and `bulk_unchunked`
37
+ customizations that will also receive notifications from implementations
38
+ of `parallel_scheduler_backend` corresponding to different iterations.
39
+
40
+ ``` cpp
41
+ template<class P, class-type Query>
42
+ optional<P> try_query(Query q) noexcept;
43
+ ```
44
+
45
+ *Mandates:* `P` is a cv-unqualified non-array object type.
46
+
47
+ *Returns:* Let `env` be the environment of the receiver represented by
48
+ `*this`. If
49
+
50
+ - `Query` is not a member of an implementation-defined set of supported
51
+ queries; or
52
+ - `P` is not a member of an implementation-defined set of supported
53
+ result types for `Query`; or
54
+ - the expression `q(env)` is not well-formed or does not have type cv
55
+ `P`,
56
+
57
+ then returns `nullopt`. Otherwise, returns `q(env)`.
58
+
59
+ *Remarks:* `get_stop_token_t` is in the implementation-defined set of
60
+ supported queries, and `inplace_stop_token` is a member of the
61
+ implementation-defined set of supported result types for
62
+ `get_stop_token_t`.
63
+
64
+ ### `query_parallel_scheduler_backend` <a id="exec.sysctxrepl.query">[[exec.sysctxrepl.query]]</a>
65
+
66
+ ``` cpp
67
+ shared_ptr<parallel_scheduler_backend> query_parallel_scheduler_backend();
68
+ ```
69
+
70
+ `query_parallel_scheduler_backend()` returns the implementation object
71
+ for a parallel scheduler.
72
+
73
+ *Returns:* A non-null shared pointer to an object that implements the
74
+ `parallel_scheduler_backend` interface.
75
+
76
+ *Remarks:* This function is replaceable [[term.replaceable.function]].
77
+
78
+ ### Class `parallel_scheduler_backend` <a id="exec.sysctxrepl.psb">[[exec.sysctxrepl.psb]]</a>
79
+
80
+ ``` cpp
81
+ namespace std::execution::system_context_replaceability {
82
+ struct parallel_scheduler_backend {
83
+ virtual ~parallel_scheduler_backend() = default;
84
+
85
+ virtual void schedule(receiver_proxy&, span<byte>) noexcept = 0;
86
+ virtual void schedule_bulk_chunked(size_t, bulk_item_receiver_proxy&,
87
+ span<byte>) noexcept = 0;
88
+ virtual void schedule_bulk_unchunked(size_t, bulk_item_receiver_proxy&,
89
+ span<byte>) noexcept = 0;
90
+ };
91
+ }
92
+ ```
93
+
94
+ ``` cpp
95
+ virtual void schedule(receiver_proxy& r, span<byte> s) noexcept = 0;
96
+ ```
97
+
98
+ *Preconditions:* The ends of the lifetimes of `*this`, the object
99
+ referred to by `r`, and any storage referenced by `s` all happen after
100
+ the beginning of the evaluation of the call to `set_value`, `set_error`,
101
+ or `set_done` on `r` (see below).
102
+
103
+ *Effects:* A derived class shall implement this function such that:
104
+
105
+ - One of the following expressions is evaluated:
106
+ - `r.set_value()`, if no error occurs, and the work is successful;
107
+ - `r.set_error(eptr)`, if an error occurs, where `eptr` is an object
108
+ of type `exception_ptr`;
109
+ - `r.set_stopped()`, if the work is canceled.
110
+ - Any call to `r.set_value()` happens on an execution agent of the
111
+ execution context represented by `*this`.
112
+
113
+ *Remarks:* The storage referenced by `s` may be used by `*this` as
114
+ temporary storage for the duration of the operation launched by this
115
+ call.
116
+
117
+ ``` cpp
118
+ virtual void schedule_bulk_chunked(size_t n, bulk_item_receiver_proxy& r,
119
+ span<byte> s) noexcept = 0;
120
+ ```
121
+
122
+ *Preconditions:* The ends of the lifetimes of `*this`, the object
123
+ referred to by `r`, and any storage referenced by `s` all happen after
124
+ the beginning of the evaluation of one of the expressions below.
125
+
126
+ *Effects:* A derived class shall implement this function such that:
127
+
128
+ - Eventually, one of the following expressions is evaluated:
129
+ - `r.set_value()`, if no error occurs, and the work is successful;
130
+ - `r.set_error(eptr)`, if an error occurs, where `eptr` is an object
131
+ of type `exception_ptr`;
132
+ - `r.set_stopped()`, if the work is canceled.
133
+ - If `r.execute(b, e)` is called, then `b` and `e` are in the range
134
+ \[`0`, `n`\] and `b` < `e`.
135
+ - For each i in \[`0`, `n`), there is at most one call to
136
+ `r.execute(b, e)` such that i is in the range \[`b`, `e`).
137
+ - If `r.set_value()` is called, then for each i in \[`0`, `n`), there is
138
+ exactly one call to `r.execute(b, e)` such that i is in the range
139
+ \[`b`, `e`).
140
+ - All calls to `execute` on `r` happen before the call to either
141
+ `set_value`, `set_error`, or `set_stopped` on `r`.
142
+ - All calls to `execute` and `set_value` on `r` are made on execution
143
+ agents of the execution context represented by `*this`.
144
+
145
+ *Remarks:* The storage referenced by `s` may be used by `*this` as
146
+ temporary storage for the duration of the operation launched by this
147
+ call.
148
+
149
+ ``` cpp
150
+ virtual void schedule_bulk_unchunked(size_t n, bulk_item_receiver_proxy& r,
151
+ span<byte> s) noexcept = 0;
152
+ ```
153
+
154
+ *Preconditions:* The ends of the lifetimes of `*this`, the object
155
+ referred to by `r`, and any storage referenced by `s` all happen after
156
+ the beginning of the evaluation of one of the expressions below.
157
+
158
+ *Effects:* A derived class shall implement this function such that:
159
+
160
+ - Eventually, one of the following expressions is evaluated:
161
+ - `r.set_value()`, if no error occurs, and the work is successful;
162
+ - `r.set_error(eptr)`, if an error occurs, where `eptr` is an object
163
+ of type `exception_ptr`;
164
+ - `r.set_stopped()`, if the work is canceled.
165
+ - If `r.execute(b, e)` is called, then `b` is in the range \[`0`, `n`)
166
+ and `e` is equal to `b + 1`. For each i in \[`0`, `n`), there is at
167
+ most one call to `r.execute(`i`, `i` + 1)`.
168
+ - If `r.set_value()` is called, then for each i in \[`0`, `n`), there is
169
+ exactly one call to `r.execute(`i`, `i` + 1)`.
170
+ - All calls to `execute` on `r` happen before the call to either
171
+ `set_value`, `set_error`, or `set_stopped` on `r`.
172
+ - All calls to `execute` and `set_value` on `r` are made on execution
173
+ agents of the execution context represented by `*this`.
174
+
175
+ *Remarks:* The storage referenced by `s` may be used by `*this` as
176
+ temporary storage for the duration of the operation launched by this
177
+ call.
178
+
179
+ <!-- Link reference definitions -->
180
+ [algorithms.parallel.exec]: algorithms.md#algorithms.parallel.exec
181
+ [allocator.requirements.general]: library.md#allocator.requirements.general
182
+ [basic.def.odr]: basic.md#basic.def.odr
183
+ [concepts.equality]: concepts.md#concepts.equality
184
+ [customization.point.object]: library.md#customization.point.object
185
+ [dcl.init]: dcl.md#dcl.init
186
+ [dcl.struct.bind]: dcl.md#dcl.struct.bind
187
+ [defns.block]: intro.md#defns.block
188
+ [except.terminate]: except.md#except.terminate
189
+ [exec]: #exec
190
+ [exec.adapt]: #exec.adapt
191
+ [exec.adapt.general]: #exec.adapt.general
192
+ [exec.adapt.obj]: #exec.adapt.obj
193
+ [exec.affine.on]: #exec.affine.on
194
+ [exec.as.awaitable]: #exec.as.awaitable
195
+ [exec.associate]: #exec.associate
196
+ [exec.async.ops]: #exec.async.ops
197
+ [exec.awaitable]: #exec.awaitable
198
+ [exec.bulk]: #exec.bulk
199
+ [exec.cmplsig]: #exec.cmplsig
200
+ [exec.connect]: #exec.connect
201
+ [exec.consumers]: #exec.consumers
202
+ [exec.continues.on]: #exec.continues.on
203
+ [exec.coro.util]: #exec.coro.util
204
+ [exec.counting.scopes]: #exec.counting.scopes
205
+ [exec.counting.scopes.general]: #exec.counting.scopes.general
206
+ [exec.ctx]: #exec.ctx
207
+ [exec.domain.default]: #exec.domain.default
208
+ [exec.env]: #exec.env
209
+ [exec.envs]: #exec.envs
210
+ [exec.factories]: #exec.factories
211
+ [exec.fwd.env]: #exec.fwd.env
212
+ [exec.general]: #exec.general
213
+ [exec.get.allocator]: #exec.get.allocator
214
+ [exec.get.await.adapt]: #exec.get.await.adapt
215
+ [exec.get.compl.sched]: #exec.get.compl.sched
216
+ [exec.get.delegation.scheduler]: #exec.get.delegation.scheduler
217
+ [exec.get.domain]: #exec.get.domain
218
+ [exec.get.env]: #exec.get.env
219
+ [exec.get.fwd.progress]: #exec.get.fwd.progress
220
+ [exec.get.scheduler]: #exec.get.scheduler
221
+ [exec.get.stop.token]: #exec.get.stop.token
222
+ [exec.getcomplsigs]: #exec.getcomplsigs
223
+ [exec.inline.scheduler]: #exec.inline.scheduler
224
+ [exec.into.variant]: #exec.into.variant
225
+ [exec.just]: #exec.just
226
+ [exec.let]: #exec.let
227
+ [exec.on]: #exec.on
228
+ [exec.opstate]: #exec.opstate
229
+ [exec.opstate.general]: #exec.opstate.general
230
+ [exec.opstate.start]: #exec.opstate.start
231
+ [exec.par.scheduler]: #exec.par.scheduler
232
+ [exec.pos]: #exec.pos
233
+ [exec.prop]: #exec.prop
234
+ [exec.queries]: #exec.queries
235
+ [exec.queryable]: #exec.queryable
236
+ [exec.queryable.concept]: #exec.queryable.concept
237
+ [exec.queryable.general]: #exec.queryable.general
238
+ [exec.read.env]: #exec.read.env
239
+ [exec.recv]: #exec.recv
240
+ [exec.recv.concepts]: #exec.recv.concepts
241
+ [exec.run.loop]: #exec.run.loop
242
+ [exec.run.loop.ctor]: #exec.run.loop.ctor
243
+ [exec.run.loop.general]: #exec.run.loop.general
244
+ [exec.run.loop.members]: #exec.run.loop.members
245
+ [exec.run.loop.types]: #exec.run.loop.types
246
+ [exec.sched]: #exec.sched
247
+ [exec.schedule]: #exec.schedule
248
+ [exec.schedule.from]: #exec.schedule.from
249
+ [exec.scope]: #exec.scope
250
+ [exec.scope.concepts]: #exec.scope.concepts
251
+ [exec.scope.counting]: #exec.scope.counting
252
+ [exec.scope.simple.counting]: #exec.scope.simple.counting
253
+ [exec.scope.simple.counting.general]: #exec.scope.simple.counting.general
254
+ [exec.set.error]: #exec.set.error
255
+ [exec.set.stopped]: #exec.set.stopped
256
+ [exec.set.value]: #exec.set.value
257
+ [exec.simple.counting.ctor]: #exec.simple.counting.ctor
258
+ [exec.simple.counting.mem]: #exec.simple.counting.mem
259
+ [exec.simple.counting.token]: #exec.simple.counting.token
260
+ [exec.snd]: #exec.snd
261
+ [exec.snd.apply]: #exec.snd.apply
262
+ [exec.snd.concepts]: #exec.snd.concepts
263
+ [exec.snd.expos]: #exec.snd.expos
264
+ [exec.snd.general]: #exec.snd.general
265
+ [exec.snd.transform]: #exec.snd.transform
266
+ [exec.snd.transform.env]: #exec.snd.transform.env
267
+ [exec.spawn]: #exec.spawn
268
+ [exec.spawn.future]: #exec.spawn.future
269
+ [exec.starts.on]: #exec.starts.on
270
+ [exec.stop.when]: #exec.stop.when
271
+ [exec.stopped.err]: #exec.stopped.err
272
+ [exec.stopped.opt]: #exec.stopped.opt
273
+ [exec.summary]: #exec.summary
274
+ [exec.sync.wait]: #exec.sync.wait
275
+ [exec.sync.wait.var]: #exec.sync.wait.var
276
+ [exec.sysctxrepl]: #exec.sysctxrepl
277
+ [exec.sysctxrepl.general]: #exec.sysctxrepl.general
278
+ [exec.sysctxrepl.psb]: #exec.sysctxrepl.psb
279
+ [exec.sysctxrepl.query]: #exec.sysctxrepl.query
280
+ [exec.sysctxrepl.recvproxy]: #exec.sysctxrepl.recvproxy
281
+ [exec.task]: #exec.task
282
+ [exec.task.scheduler]: #exec.task.scheduler
283
+ [exec.then]: #exec.then
284
+ [exec.unstoppable]: #exec.unstoppable
285
+ [exec.when.all]: #exec.when.all
286
+ [exec.with.awaitable.senders]: #exec.with.awaitable.senders
287
+ [exec.write.env]: #exec.write.env
288
+ [execution.syn]: #execution.syn
289
+ [expr.await]: expr.md#expr.await
290
+ [expr.const]: expr.md#expr.const
291
+ [func.def]: utilities.md#func.def
292
+ [func.require]: utilities.md#func.require
293
+ [function.objects]: utilities.md#function.objects
294
+ [intro.multithread]: basic.md#intro.multithread
295
+ [intro.progress]: basic.md#intro.progress
296
+ [intro.races]: basic.md#intro.races
297
+ [meta.trans.other]: meta.md#meta.trans.other
298
+ [namespace.std]: library.md#namespace.std
299
+ [task.class]: #task.class
300
+ [task.members]: #task.members
301
+ [task.overview]: #task.overview
302
+ [task.promise]: #task.promise
303
+ [task.state]: #task.state
304
+ [term.replaceable.function]: dcl.md#term.replaceable.function
305
+ [thread.req.lockable.general]: thread.md#thread.req.lockable.general