6.21 Consider a system running ten I/O-bound tasks and one CPU-bound task. Assume that the I/O-bound tasks issue an I/O operation once for every millisecond of CPU computing and that each I/O operation takes 10 milliseconds to complete. Also assume that the context-switching overhead is 0.1 millisecond and that all processes are long-running tasks. Describe the CPU utilization for a round-robin scheduler when: a. The time quantum is 1 millisecond b. The time quantum is 10 milliseconds
时间: 2024-03-19 08:40:51 浏览: 145
a. If the time quantum is 1 millisecond, the CPU utilization for a round-robin scheduler will be approximately 90.91%. This is because each I/O-bound task will consume 1 millisecond of CPU time and 10 milliseconds of I/O time in each quantum. The CPU will be idle for 9 milliseconds in each quantum, resulting in a CPU utilization of (10/11)*100 = 90.91%. The CPU-bound task will consume 1 millisecond of CPU time in each quantum, resulting in a CPU utilization of 10%.
b. If the time quantum is 10 milliseconds, the CPU utilization for a round-robin scheduler will be approximately 9.9%. This is because the CPU-bound task will consume the entire quantum of CPU time, resulting in a CPU utilization of 100%. Each I/O-bound task will consume 10 milliseconds of I/O time in each quantum, and the context-switching overhead will be 0.1 millisecond. Therefore, the CPU will be idle for (10-10.1) milliseconds in each quantum, resulting in a CPU utilization of (1/10.1)*100 = 9.9%.
阅读全文