Consider three processes, all arriving at time zero, with total execution time…
2006
Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30 units, respectively. Each process spends the first 20% of execution time doing I/O, the next 70% of time doing computation, and the last 10% of time doing I/O again. The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a new process either when the running process gets blocked on I/O or when the running process finishes its compute burst. Assume that all I/O operations can be overlapped as much as possible. For what percentage of time does the CPU remain idle?
- A.
0%
- B.
10.6%
- C.
30.0%
- D.
89.4%
Attempted by 42 students.
Show answer & explanation
Correct answer: B
First, calculate the I/O and computation times for each process:
Process 1: I/O (2) → CPU (7) → I/O (1) Process 2: I/O (4) → CPU (14) → I/O (2) Process 3: I/O (6) → CPU (21) → I/O (3)
At t=0, all processes start I/O. The first process becomes ready for CPU at t=2 (Process 1), creating an initial idle period of 2 units.
The total computation time is 42 units. The final process completes all I/O at t=47, defining the total execution window.
CPU remains idle for 5 units (2 initially + 3 at the end). The idle percentage is calculated as 5 / 47 ≈ 10.6%.
A video solution is available for this question — log in and enroll to watch it.