Relative Content

Tag Archive for c++multithreadinglock-freelockless

Data not ordered properly in lockless spsc queue

I’m trying to write a bounded lockless single-producer, single-consumer queue, however, the order of elements inserted into the queue is not the same as the order of the elements removed from the queue. The test code in main.cpp adds 100,000,000 sequential ints to the queue in one thread, and pops the values in another, checking that the values are sequential.