The producer-consumer problem (bounded-buffer problem) is a classic synchronisation problem where producers generate data into a shared fixed-size buffer, and consumers retrieve and process it.
Requirements
Mutual Exclusion
Only one process (producer or consumer) may access the buffer at any time to prevent data corruption.