u/d1722825in r/C_Programming • Recommends
On “Is my lock-free queue good?”
I'm not sure if it even possible to do it with ring buffers, maybe >!if you start skipping elements (but that is not really a ring buffer anymore), or if you have a different ring buffer for each producer (but that is not really MPMC).!<
Herb Sutter had a very good (and in-depth) talk about lock-free programming (it's about C++, but atomics are quite simlimar to C): part 1 and part 2.
Oh, and I suspect at some points you could use a less strict memory ordering, than the default sequentially-consistent one, if you really want to start questioning your sanity :)