[OS] CPU utilization

看板Grad-ProbAsk作者 (絕代風華賈奈特)時間8年前 (2017/05/17 16:36), 編輯推噓2(208)
留言10則, 2人參與, 最新討論串1/2 (看更多)
還想請問大家這題的解析,因為根據題目所提供的情況, Consider the system running ten 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 millisecond to complete. Also assume that the context switching overhead is 0.1 millisecond and that all processes are long-running tasks. What is the CPU utilization for RR scheduler when: (1)time quantum=1 millisecond (2)time quantum= 10 millisecond 可以了解CPU burst(T)=1, I/O=10,context switch=0.1 (1)第一題沒有問題,因為T=Q,所以CPU utilization=T/S+T=1/1+0.1=1/1.1 (2)第二題我就不太了解為何會有20,畢竟Q=10,Q>T,所以應該是T/S+T=1/1+0.1, 為何會是答案所給的20/21.1呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.118.135.18 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1495010164.A.C64.html

05/17 19:33, , 1F
考完就荒廢了不太確定,不過如果我沒想錯應該是像這樣吧
05/17 19:33, 1F

05/17 19:33, , 2F
(我假設每個I/O burst tasks一次都只花1ms
05/17 19:33, 2F

05/17 19:33, , 3F

05/17 19:34, , 4F
糟糕,本來寫T後面不小心寫成P了XD總之那個代表I/O的 叉
05/17 19:34, 4F

05/17 19:34, , 5F
叉是context switch
05/17 19:34, 5F

05/17 23:03, , 6F
謝謝n大的解答,但想請問一下題目中不是說只有一個cpu
05/17 23:03, 6F

05/17 23:04, , 7F
BURST跟10個I/O嗎?為何n大的解答是一個I/O+10XCPU呢
05/17 23:04, 7F

05/18 03:19, , 8F
蛤 我寫的意思是一個cpu burst啊 C的那格就是 跑10ms 後
05/18 03:19, 8F

05/18 03:19, , 9F
面一個一個小格的是I/O 1~10號
05/18 03:19, 9F

05/18 14:50, , 10F
原來如此,感謝
05/18 14:50, 10F
文章代碼(AID): #1P70jqna (Grad-ProbAsk)
文章代碼(AID): #1P70jqna (Grad-ProbAsk)