Question: version of the bounded buffer problem in which there are one producer process (P) and we start with a completely empty buffer. The structure of

version of the bounded buffer problem in which there are one producer process (P) and we start with a completely empty buffer. The structure of Pi, P, and Ps as well as the 0 p, item 1 (P, and Ps) all sharing the same buffer. Assume that the size of the buffer is n two consumer processes = 4, and that semaphores and buffer is shown below /structure of P1 do f structure of P2 & P3 P do - wait (full) wait (mutex) nex tp buffer [out] out (out + 1) % n signal (mutex) signal (empty) litem 2 tem3 produce an item in nextp wait (empty) wait (mutex) buffer tin]- nextp 0 0 4. in = (in + 1) % n ut mpty full signal (mutex) signal (ful1) consume item in nextp /while (1) )while (1) utex Assume a preemptive scheduler and that all processes start in the ready queue at the same time in th order from head to tail, PI, P2, and P3 (P3 at the head of the queue). Let the process priorities be:1 -2, P2 2, and P1 4. Draw the contents of the indices "in" and "out", as well as the state of the semaphores and the ontents of the buffer after 2 items have been consumed. In the case of the buffers, simply nota ach 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
