Blocking Queue

queue for passing messages between threads

Fig 1. BlockingQueue Diagram
Fig 2. BlockingQueue Class

1.0 Concept

CppBlockingQueue provides a thread-safe message queue that blocks deQuer when empty. It is intended to pass messages between threads in concurrent designs, e.g., asynchronous message-passing communication systems.
This is a small repository holding a single package for this reusable component.

2.0 Implementation

The blocking queue is a template class, implemented using std::mutex and std::condition_variable.

3.0 Build

CppBlockingQueue was built with Visual Studio Community Edition - 2019, and tested on Windows 10.

4.0 Status

I've used CppBlockingQueue in my own designs and students have used it for several years without problems. The class has a copy constructor and copy assignment which I plan to set to delete. as the underlying std::mutex and std::cond_var do not have copy semantics.