 GFG App
Open App Browser
Continue

# GATE | GATE-CS-2003 | Question 90

A uni-processor computer system only has two processes, both of which alternate 10ms CPU bursts with 90ms I/O bursts. Both the processes were created at nearly the same time. The I/O of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least CPU utilization (over a long period of time) for this system ?
(A) First come first served scheduling
(B) Shortest remaining time first scheduling
(C) Static priority scheduling with different priorities for the two processes
(D) Round robin scheduling with a time quantum of 5 ms

Explanation: When Round Robin scheduling is used
We are given that the time slice is 5ms. Consider process P and Q.
Say P utilizes 5ms of CPU and then Q utilizes 5ms of CPU. Hence after 15ms P starts with I/O And after 20ms Q also starts with I/O. Since I/O can be done in parallel, P finishes I\O at 105th ms (15 + 90) and Q finishes its I\O at 110th ms (20 + 90). Therefore we can see that CPU remains idle from 20th to 105th ms.
That is when Round Robin scheduling is used,
Idle time of CPU = 85ms
CPU Utilization = 20/105 = 19.05%

When First Come First Served scheduling scheduling or Shortest Remaining Time First is used
Say P utilizes 10ms of CPU and then starts its I/O. At 11th ms Q starts processing. Q utilizes 10ms of CPU.
P completes its I/O at 100ms (10 + 90)
Q completes its I/O at 110ms (20 + 90)
At 101th ms P again utilizes CPU. Hence,
Idle time of CPU = 80ms
CPU Utilization = 20/100 = 20%

Since only two processes are involved and I\O time is much more than CPU time, “Static priority scheduling with different priorities” for the two processes reduces to FCFS or Shortest remaining time first.
Therefore, Round robin will result in least CPU utilization.

My Personal Notes arrow_drop_up