Professional Documents
Culture Documents
Documentation - Laboratory 5: Answer The Following Questions
Documentation - Laboratory 5: Answer The Following Questions
Documentation - Laboratory 5: Answer The Following Questions
Make the program produce one item that the consumer immediately
consumes.
First of all I had a closer look at all the classes given to better understand how to program works, after
studying the program it was clear that the change had to be made in the produce() method in the
ProducerConsumer class so I changed the method so the produce function will only make one item at a
time and then notifies the other thread to consume it.
Before After