lockless: implement a mpsc ring buffer

Operating Systems / OSv - Guy Zana [cloudius-systems.com] - 8 July 2013 04:46 UTC

multi-producer / single-consumer lockless ring buffer of fixed size.

if push() fails it returns an index to be attempted again until it succeeds with push_to(). note that it does fit our use case, since we want to wait until push succeeds -it is even more fair since if push fail, it reserves a slot to be attempted again.

96e18aa lockless: implement a mpsc ring buffer
include/lockfree/ring.hh | 81 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)

Upstream: github.com


  • Share