Create a process that has producer thread and a consumer thread. Both threads access a finite buffer
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a process that has producer thread and a consumer thread. Both threads access a finite buffer of MAX_LENGTH and the items in the buffer are integers. By the time the program terminates all produced items should be consumed, in the right order (FIFO), and the final buffer should be empty.
Your program should:
a. Read an input from the user to specify the number of items the producer should produce.
b. Show when each thread is running the item number that was either produced or consumed and the count of how many items are left in the buffer.
c. The final count of items of the buffer should be zero.
Related Book For
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord
Posted Date: