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 Request
    

    Request type.

  • typename Response
    

    Response type.

  • auto N
    

    Number of requests processed in parallel.

  • auto FifoDepth = 32
    

    Depth of internal FIFOs. Larger values are needed to achieve full throughput if Process is 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 start after the first are ignored.

    Arguments

    • (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 Index
      

      Index of the request in the request array passed to Process.