A uni-processor computer system only has two processes, both of which alternate CPU bursts with 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?
View worked solution
Answer: D
To find the scheduling strategy that results in the least CPU utilization, let us analyze the execution timelines for the processes and under the given strategies. Each process has a CPU burst of and an I/O burst of .
1. FCFS, SRTF, and Static Priority Scheduling:
Under these non-preemptive or priority-based schemes, one process completes its entire CPU burst before the other starts:
- At , runs on the CPU until , then goes for I/O (ready at ).
- At , runs on the CPU until , then goes for I/O (ready at ).
- The CPU remains idle from to .
- At , returns and the cycle repeats.
The total cycle length is (from to ), during which the CPU is busy for ( for and for ).
2. Round Robin (RR) with Time Quantum = :
Because of preemption, the execution interleaves:
- : runs (remaining = ).
- : runs (remaining = ).
- : runs and finishes, going to I/O (ready at ).
- : runs and finishes, going to I/O (ready at ).
- The CPU is idle from to .
- At , returns and runs until (remaining = ).
- At , returns. Since has completed its quantum, a context switch occurs. runs from (remaining = ).
- : finishes and goes to I/O (ready at ).
- : finishes and goes to I/O (ready at ).
The repeating cycle now runs from to , which has a duration of . During this cycle, the CPU is active for (from to ).
Since , Round Robin scheduling with a time quantum of results in the least CPU utilization.
Free practice · Your answers on this page are not saved.
