Question: Redo the produce/consumer program so that it allows multiple consumers. The program will prompt the user for the number of consumers. Each consumer must be
Redo the produce/consumer program so that it allows multiple consumers. The program will prompt the user for the number of consumers. Each consumer must be able to consume the same data before the producer produces more data. The program will prompt the user for the number of accesses (data items produced and consumed). The program will contain three Classes, SharedCell, Consumer, and Producer. Use the code presented in section 1 of the textbook as a starting point. Use the updated SharedCell code on page 408.
Run the program with the following data:
Run 1 Consumers = 4; Accesses =4
Run 2 Consumers =6, accesses = 2
Run 3 Consumers = 4; Accesses = 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
