Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
/ ringbuffer Public archive

Simple ring buffer for a single producer and multiple consumers

License

Notifications You must be signed in to change notification settings

tdekeyser/ringbuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ringbuffer

Implementation of a simple ring buffer for a single producer and multiple consumers.

Each thread has its own index. Calling ringbuffer_insert (write) and ringbuffer_peek (read) increments the caller's index. Thread safety is guaranteed by the fact that the producer can never overtake the slowest consumer, and none of the producers are not allowed to overtake the producer.

Written while learning C and based on LMAX Disruptor (https://lmax-exchange.github.io/disruptor/).

playing around with the code

Running the tests can be done by running the build script

./run_ringbuffer_tests.sh

The executable will be put in a build/ folder under the main directory of the project.

Note that you will need Catch (more specifically the catch.hpp file) and put it under test/Catch.

About

Simple ring buffer for a single producer and multiple consumers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published