control.async.rendezvous.strict ≡
Rendezvous with a fixed number of threads.
template <typename Request, typename Response, auto N, auto FifoDepth = 32> class rendezvous §source
Join exactly N 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 NNumber 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((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
-
(Request[N]) -> Response[N] process_fnFunction 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.
-