Producer consumer

Producers share a bounded buffer of size K.

  • Producers produce items to insert in buffer

  • Only when the buffer is not full (< K items)

  • Consumers remove items from buffer

  • Only when the buffer is not empty (> 0 items)

Producer consumer: Busy waiting

Producer consumer: Blocking