Question: Process Coordination Name Due: 3/7/19 Consider a version of the bounded buffer problem in which there are one producer process (P) and two consumer processes

Process Coordination Name Due: 3/7/19 Consider a version of the bounded buffer problem in which there are one producer process (P) and two consumer processes (P2 and P) all sharing the same buffer. Assume that the size of the buffer is n - 4, and that we start with a completely empty buffer. The structure of Pi, P2, and P, as well as the semaphores and buffer is shown below 1. /structure of P2 & P3/ /*structure of Pl/ do wait (full) wait (mutex) nextpbuffer lout] out (out + 1) n signal (mutex) signal (empty) tem 0 item l item 2 item3 produce an item in nextp wait (empty) wait (mutex) buffer [in]- nextp in-(in + 1) % n signal (mutex) signal (full) in consume item in next;p ut 4 empty )while (1) )while(1) 1l utex 0 Assume a preemptive scheduler and that all processes start in the ready queue at the same time in the order from head to tail, P1, P2, and P3 (P3 at the head of the queue). Let the process priorities be: P3 2, P2-2, and Pl4 Draw the contents of the indices "in" and "out", as well as the state of the semaphores and the contents of the buffer after 2 items have been consumed. In the case of the buffers, simply notate each item with the name of the process that accessed it last
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
