Don't wrap the entire send/response cycle in a counting semaphore.
While the counting semaphores may be redundant anyway (needs to be confirmed, but bus_send_request is already blocking until the send is complete, with extra backpressure), additinoally holding on to the count until the response arrives and the unpacked message callback is called limits the total number of responses that can be pending, which is not the intention. The message bus itself should do that, but allow for significantly more pipelining than the counting semaphor with a limit of 10.
Loading
Please sign in to comment