Skip to content

The implementation of a fast lock-free and allocation-free multi-producer/multi-consumer (MPMC) queue in C++

License

Notifications You must be signed in to change notification settings

ixotoxin/fast_mpmc_queue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast Lock-Free Multi-Producer/Multi-Consumer Queue

This is a C++ implementation of a fast multi-producer/multi-consumer queue. Two variants are provided: one with a dynamically growing buffer and another with a fixed-size buffer (which requires no allocations). The queue is composed of slots, and communication between producers and consumers happens through writing to and reading from these slots. This design minimizes the number of allocations, deallocations, and memory fragmentation, while ensuring consistent performance over time. In the case of the fixed-size buffer, allocations are eliminated entirely.

The repository also contains classical implementations of MPSC and MPMC queues that were used for performance comparison.

About

The implementation of a fast lock-free and allocation-free multi-producer/multi-consumer (MPMC) queue in C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published