作者sa074463 (壘包)
看板Grad-ProbAsk
標題[理工] [OS]-CPU utilization
時間Thu Mar 11 10:31:00 2010
這是先前成大考的題目
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.1millisecond and that all processes are long-running tasks.
What is the CPU utilization for a round-robin scheduler when:
(a) The time quantum is 1 millisecond
(b) The time quantum is 10 milliseconds
我還是蠻不懂的(看了先前的文章)
------------------我是分隔線-----------------
(a)恐龍給1/(1+0.1)
分母是一個time quantum+一個context swiching的時間,那分子是什麼?
time quantum的時間嗎? 那還要不要加上發出I/O operation的1ms??
也就是(1+1)/(1+0.1),還有10個I/O bound job不用看它??
(b)前面的人有說10個I/O bound+context swiching=(1+0.1)*10
加上CPU bound+context swiching用的時間有10.1ms,所以分母為11+10.1=21.1
這時候為什麼10個I/O bound要考慮進來? 因為time quantum剛好可以發出10個
I/O operation嗎?那分子是看CPU-bound+發出10個I/O operation所以為10+10?
我不太會算這種題型,麻煩指教一下T_T
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.62.95.211
※ 編輯: sa074463 來自: 61.62.95.211 (03/11 10:31)
※ 編輯: sa074463 來自: 61.62.95.211 (03/11 10:31)
推 assassin88:a.是因為quantum只有1,所以時間到了就結束。 03/11 10:34
→ assassin88:b.因為quantum還未用完,他就必須做I/O,所以要考慮。 03/11 10:35
※ 編輯: sa074463 來自: 61.62.95.211 (03/11 10:37)
→ sa074463:那a.的分子為1就是cpu花在quantum的時間瞜?? 03/11 10:39
推 s890510:應該可以這樣說是的~~因為cpu utilization就是CPU在執行 03/11 10:43
→ s890510:時所花的時間/總共所花費的時間 (成大題目有給公式) 03/11 10:44
→ s890510:而這題是要求計算CPU utilization所以分子就只要看CPU花的 03/11 10:45
→ s890510:時間即可! 03/11 10:45
推 polomoss:畫一下gantt chart就懂了 03/11 11:00