Producer-Consumer With pthreads
Problem
Implement a bounded buffer shared by producer and consumer threads using mutex + condition variables.
Example
Buffer size N; no busy-wait; no race
Constraints
- Multiple producers/consumers
What evaluators look for
Correct synchronization, no deadlock, and reasoning about condition variables.
added …