-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
The ProducerConsumerQueue in util is meant to be used by separate threads for reading and writing. It would be useful if it had specific types for those operations, which would statically enforce the correct usage of the type.
A helper method would probably look something like:
auto [producer, consumer] = makeProducerConsumerQueueHalves(...);
which would create the queue with make_shared, and construct each half with a shared ref.
The halves would each own the half of the api they use. On destruction, they'd call their associated close.
- duplicates
-
SERVER-37797 Modify the producer consumer queue to make it safe for multi-producer scenarios
- Closed