concurrentqueue
concurrentqueue copied to clipboard
Multi-producer single consumer model, consumption order and production is inconsistent
Multiple threads receive stock ticker data, store it in the queue, and a single thread takes out data from the queue for processing, and finds that it is not strictly in accordance with the order of consumption, and some stocks begin to consume after the close.
This is covered in the README. Order is only preserved between elements enqueued by a given producer.
Can FIFO be guaranteed with one producer and one consumer? I've tried and it doesn't seem to work. Is there any configuration or overloading required?
With one producer FIFO is guaranteed. Can you share a counterexample?