Do any of you use/need a lockless queue? What do you use? I don’t mind if the code is C++, I was thinking maybe I should write a very simple one for my own use
Do yourself a favor and use a mutex. It is possible to write a safe lockless queue, but as soon as you add operations that you would expect a queue to have besides push and pop, you get very hard to find bugs. 99% of the time a lock is the right solution.
2 Likes