Producer Consumer Program
A producer thread places jobs in a bounded-buffer,
and these jobs are retrieved by a consumer thread.
-
When initially started up, the program creates a producer thread object
and a consumer thread object.
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 producer produces 20 jobs, the last 10 of them slowly.
-
The consumer consumes 20 jobs, the first 10 of them slowly.
Source Code of the ProdCons Program
Source Code of the ProdConsG Program
(Graphical Version)
Back
Home