dougct / ring-buffer

A multi-thread lock-free ring buffer implementation in C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ring buffer implementation in C++

This repository contains two implementations of ring buffers in C++:

  • A single-thread ring buffer to help us understand the challenges/tradeoffs of a real-world ring buffer.
  • A multi-thread implementation which is pretty similar to state-of-the-art implementations such as the one in folly.

Here's a blog post with a detailed description of each implementation.

How to build and run

To run the test for the single-thread ring buffer, do:

make test version=single

And just do make test to run the tests for the multi-thread ring buffer.

To run a simple benchmark, just do make bench.

About

A multi-thread lock-free ring buffer implementation in C++

License:Apache License 2.0


Languages

Language:C++ 97.3%Language:Makefile 2.7%