Question: Consider a version of the bounded buffer problem in which there are one producer process (P1) and two consumer processes (P2 and P3) all sharing
Consider a version of the bounded buffer problem in which there are one producer process (P1) and two consumer processes (P2 and P3) 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 Ps as well as the semaphores and buffer is shown below: structure of P1 / / structure of P2 & P3 / do tem 0 item 1 item 2 tem3 do wait (full) wait (mutex) nextp buffer lout] out = (out + 1) n signal (mutex) signal (empty) produce an item in nextp wait (empty) wait (mutex) buffer lin] nextp in = (in + 1) % n signal (mutex) signal (full) consume item in nextp 0 4 empty o full out Jwhile (1) )while (1) mutex 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: P? 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 ach item with the name of the process that accessed it last. simply notate
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
