Producer Consumer Program
A couple of producer threads place jobs in a bounded-buffer,
and these jobs are retrieved by a couple of consumer threads.
-
When initially started up, the program creates two producer thread objects
and two consumer thread objects.
The threads then can be started by pressing the Step button.
-
You can kill and recreate the producer and consumer threads by pressing
the Restart button and
start them with the Step button.
-
The Delay and Continue buttons have no effects.
-
The producers produce 20 jobs, the last 10 of them slowly.
-
The consumers consume 20 jobs, the first 10 of them slowly.
Source Code of the ProdCons Program
Source Code of the ProdConsG Program (Graphical Version)
Jacob's CS 261 Demos
Jacob's CS 261 Home