##### please explain.. i am getting 10 and given ans is 12.

i am getting 10 and given ans is 12.

Nishant Vijayvergiya
9 Jan 2015 06:22 pm

P3 finishes service by 7. By that time P1 would have finished [4 (service time) + 3 (i/o time)] its I/o & P2 would be waiting in the i/o queue.after 5 time units p2 n p3 both would finish their execution

therefore,7+5=12

Arul
9 Jan 2015 06:22 pm

the answer is 12. notice that, only one IO device is present in the system & so, only one process can be serviced at a time.

P3 finishes CPU execution at time 7 & finishes IO at time 12.

jayendra
9 Jan 2015 06:25 pm

can we overlap i/o waiting time of two processes?

Nishant Vijayvergiya
9 Jan 2015 06:30 pm

they have specified only 1 i/o device,so you cant

Ranita Biswas
9 Jan 2015 07:25 pm

Jayendra, as you still have doubt in this question, let me try to draw the diagram which should explain you the concept.

 Time → 1 2 3 4 5 6 7 8 9 10 11 12 13 CPU P1 P2 P3 P4 I/O P1 P2 P3 P4

At time t = 8, both P2 and P3 are waiting to be served in the I/O queue, but as P2 was put in the queue before P3, P2 will be served at t=8. Similarly, at t = 10, though both P3 and P4 were waiting, P3 is served first by I/O. We can of course overlap the waiting time of two processes, but cannot overlap processing time, as only one I/O device is there.

So, as processing of P3 ends at t = 12, answer is indeed 12 as given by others.

jayendra
10 Jan 2015 08:27 pm

ok, now i got, thank you... i was thinking about i/o waiting time only, and given is i/o service time.. thank you