Producer-Consumer With a Bounded Buffer
Problem
Implement a thread-safe bounded queue with blocking put/take supporting multiple producers and consumers.
Example
Buffer size 1; a producer and a consumer alternate without busy-waiting
Constraints
- No data races, no deadlock, no busy-waiting
added …