concurrentqueue icon indicating copy to clipboard operation
concurrentqueue copied to clipboard

Multi-producer single consumer model, consumption order and production is inconsistent

Open fxsts opened this issue 1 year ago • 3 comments

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.

fxsts avatar Jun 18 '24 07:06 fxsts

This is covered in the README. Order is only preserved between elements enqueued by a given producer.

cameron314 avatar Jun 18 '24 07:06 cameron314

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?

fxsts avatar Jun 20 '24 11:06 fxsts

With one producer FIFO is guaranteed. Can you share a counterexample?

cameron314 avatar Jun 20 '24 21:06 cameron314