COM310 / Processes

Producer and consumer with an unbounded buffer

Try it yourself

Make the producer faster than the consumer and watch the buffer grow. Then flip them and see who waits.

Trace the code

Screen output

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