A uni-processor computer system only has two processes, both of which…

2003

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 ?

  1. A.

    First come first served scheduling

  2. B.

    Shortest remaining time first scheduling

  3. C.

    Static priority scheduling with different priorities for the two processes

  4. D.

    Round robin scheduling with a time quantum of 5 ms

Attempted by 91 students.

Show answer & explanation

Correct answer: D

Key idea: scheduling that introduces frequent preemption increases context-switch overhead, which reduces the CPU's effective utilization.

Why most strategies give the same baseline utilization (ignoring context-switch overhead):

  • Each process does 10 ms of CPU work and then 90 ms of I/O, so over a 100 ms cycle the two processes together need 20 ms of CPU time. If context-switch overhead is negligible, the CPU is usefully busy about 20% of the time.

Effect of each scheduling strategy (including context-switch behavior):

  • First-come first-served: One process runs its full 10 ms burst, then the other runs. Few context switches, so usable CPU time is close to the 20 ms baseline.

  • Shortest-remaining-time-first: With equal 10 ms bursts this behaves like FCFS (no extra preemptions). Usable CPU time stays near the baseline.

  • Static priority with different priorities: The higher-priority process runs first, then the other. The observable pattern and context-switch count are similar to FCFS, so usable CPU time remains near the baseline.

  • Round robin with 5 ms quantum: Each 10 ms CPU burst will be divided into multiple quanta when both processes are ready. This causes additional preemptions and extra context switches. Because context switches consume CPU cycles for dispatching, the effective useful CPU time is reduced below the baseline, giving the lowest overall CPU utilization.

Conclusion: Round robin with a 5 ms quantum results in the least CPU utilization because frequent time slicing increases context-switch overhead and reduces the fraction of CPU time available for productive work.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir