MODULE 3 S16 1. Fill in the Gant chart based on these conditions: (P, V, and context switch operations are instantaneous). Process P1 starts at time…

Fill in the Gant chart based on these conditions: (P, V, and context switch operations are instantaneous).
      Process P1 starts at time 0; P2 at time 3; P3 at time 6; P4 at time 8; and P5 at time 10.

Initially semaphore x = 1; Process priorities are: P1 < P2 < P3 < P4 < P5;    //no priority inheritance

After 3 time units P1 executes a P(x) call; after 3 more time units it executes a V(x) call and is finished.
After 3 time unit P2 executes a P(x) call; after 2 more time units it executes a V(x) call and is finished.

P3 does not execute any P(x) or V(x) calls and finishes after completing its 3 time units.
After 3 time units P4 executes a P(x) call; after 3 more time units it executes a V(x) call and is finished.

After 2 time unit P5 executes a P(x) call; after 2 more time units it executes a V(x) call and is finished.

Release from the semaphore queue is based on FIFO.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply