control.async.rendezvous.lenient ≡
Rendezvous with a variable number of threads.
template <typename Request, typename Response, auto N, auto FifoDepth = 32> class rendezvous §source
Join up to up to N distinct threads into a group. Each
thread contributes one request to an array of requests before that
thread blocks. A single function processes the combined array of
requests to generate an array of responses. One response is sent to each
thread and each thread in the group is unblocked.
Parameters
-
typename RequestRequest type.
-
typename ResponseResponse type.
-
auto NMaximum number of requests processed in parallel.
-
auto FifoDepth = 32
Depth of internal FIFOs. Larger values are needed to achieve full throughput if
Processis a high latency.
Methods
-
inline void start((optional<Request>[N]) -> Response[N] process_fn) §source
Must be called before any requests will be processed. All calls to
startafter the first are ignored.Arguments
-
(optional<Request>[N]) -> Response[N] process_fn
Function that processes requests to generate responses.
-
-
template <auto Index> Response join(Request req) §source
Submits a requests, blocks until the corresponding response is generated, and returns the response.
Parameters
-
auto IndexIndex of the request in the request array passed to
Process.
-