COM310 / Processes

Producer and consumer with a bounded buffer

Try it yourself

Make the producer faster than the consumer, then the other way around. Watch who ends up waiting, and try different sizes.

Trace the code

Screen output

The arrow keys and the space bar control the section you clicked last.
C code: bounded.c