Skip to content

An intrusive lock-free multiple-producer, single-consumer queue in C++

License

Notifications You must be signed in to change notification settings

samanbarghi/MPSCQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MPSCQ

This is an intrusive lock-free multiple-producer, single-consumer queue inspired by Dmitry Vyukov's implementation ( here, and here).

There is an intrusive blocking, an intrusive non-blocking, and non-intrusive blocking version in the src/MPSCQ.h. For all cases consumer only spins if the producer is blocked before performing prev->next = &first;. The while loops can be replaced with return statements to avoid unnecessary spinning (e.g., to check other queues or perform other work until the producer is unblocked).

Blocking queues only return true and false pop which indicates whether the queue is empty or not, and thus whether the caller should block or not (blocking is done by the caller). There are examples in test directory.

About

An intrusive lock-free multiple-producer, single-consumer queue in C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published