C++ Lock-Free Queue - Part II
In Part I of this blog series, we discussed how to write a lock-free queue for the case of a single producer thread and a single consumer thread (SPSC). This is handy when sending messages between dedicated threads, but we often want to have multiple...
radiantsoftware.hashnode.dev16 min read
Andrew Michell
Hi Paul, excellent post! I wrote a Reserve_PopSlot function that closely resembles Reserve_EmplaceSlot and added some tests. SPSC, MPSC, SPMC all work great, however I'm running into an issue with MPMC consumer thinking that the queue is empty because cIndices.mUnwrappedPushIndex == cIndices.mUnwrappedPopIndex but mSize is not 0. Have you experienced this?... If you send me your email I can respond with my implementation of Reserve_PopSlot. Thank you!