81.9k views
0 votes
A uni-processor computer system has only two processes, both of which alternate 10 ms CPU burst with 90 ms I/O burst. Both processes were created at nearly the same time. The I/O of both processes can proceed in parallel. Calculate the CPU utilization (over a long period of time) for SJF and RR scheduling.

User Avinash R
by
8.0k points

1 Answer

1 vote

Final answer:

CPU utilization for both Shortest Job First (SJF) and Round Robin (RR) scheduling approaches 100% over a long period as both processes alternate between CPU bursts and I/O operations, which can be done in parallel.

Step-by-step explanation:

For Shortest Job First (SJF) scheduling, both processes will have the same burst and behavior, meaning the algorithm will treat them equally. SJF would effectively alternate between the two processes. Each process uses 10 ms of CPU time and then performs 90 ms of I/O. Since I/O operations don't occupy the CPU, both can be done in parallel, meaning that while one process is performing I/O, the other can utilize the CPU. This scheduling results in virtually no CPU idle time.

For Round Robin (RR) scheduling, assuming a time quantum that is equal to or greater than 10 ms, the CPU will switch between processes at the end of each CPU burst, before they go on to perform I/O operations. Similar to SJF, the CPU utilization would be high because while one process is in I/O, the other can use the CPU.

Over a long period, the CPU utilization for both SJF and RR will approach 100%, as the processes are continuously alternating between CPU and I/O without any significant waiting time for the CPU.

User Milkyway
by
8.1k points