in Operating System
116 views
0 votes
0 votes
in Operating System
116 views

1 Answer

1 vote
1 vote

Processes P1, P2, and P3 run on the CPU for a minimum time (i.e., 0 ms) and then go for I/O operation. 

Process P1 returns at time 2ms (processor remains idle for 2ms) and runs till 9ms and goes for I/O operation at 9ms. Now process P2 runs for 1ms because P1 arrives from I/O at time 10ms and P1 has the least burst time, then P1 runs for 0ms, completing its execution.

Similarly, P2 runs till 23 ms and goes for I/O. Now, Process P3 will run for 2 ms because P2 arrives at 25 ms and it has the least burst time. P2 runs for 0 ms, completing its execution.

Now Process P3 will run from 25 ms to 44 ms, go for I/O, and return at 47 ms. The processor will remain idle for 3 ms. At 47 ms, P3 will run for 0 ms, completing its execution.

Total time taken by the processes = 47 ms

Total time when the processor remains idle = 2+3 = 5 ms

Useful time = 44 ms

Percentage of time CPU remains free = 10.64%

Related questions