Respuesta :
Answer / Explanation:
According to question given at every 1 millisecond, i/o operation done and it will be completed in 10 ms . so 10 i/o operation have
Time = 10 * 1 + .1 * 10 = 11ms ...(here 0.1 switching overhead )
cpu task for which we can consider it runs for 10 ms because i/o operation will be completed in 10ms ... (given as all process are long running tasks)
so if case 1 ... time quantum is 1ms then cpu task takes = 10*1+10*0.1(switching after every 1ms quantum time) = 11ms
Therefore,
cpu utilization = useful work/ total work
= (10 * 1 + 10 * 1) / 11 + 11 = 20/22 =90.90%
case 2 time quantum = 10ms,
so cpu takes = 10*1+1*.1=10.1
cpu utilization = 20/ 11+10.1= 20/ 21.1 = 94.78%
For further clarity,
We could consider the below approach for solving the question.
(a) Time quantum is 1 ms.
Whether a CPU bound or I/O bound process, it switches every one millisecond and when doing so, it incurs a 0.1 ms overhead. Thus, for every 1.1 ms, the CPU is actually utilized only 1 ms. So CPU utilization is 11.1 ∗ 100 = 91%
(b) Time quantum is 10 ms.
Here, there is a difference between CPU bound and I/O bound processes. A CPU bound process can use the full 10 ms time slot, whereas an I/O bound process can have it only for 1 ms because another I/O bound process in the queue will snatch the time from it.
So a CPU bound process takes 10 ms, 10 I/O bound processes would take 10*1 =10ms. So, the CPU would be utilized for a total of 20 ms out of 21.1 ms. (Total time is 10*1.1 + 10.1=21.1ms).
Thus the CPU utilization is 2021.1∗100 = 95%