推 yesa315:恩恩 謝謝! 10/06 20:48
※ 引述《yesa315 (XD)》之銘言:
: Suppose the Linux scheduler chooses the process with the most credits for
: run, and if no runnable processes can be chosen, the recrediting operation is
: performed according to the following rule for every process in the system:
: credits=credits/2+priority
: For each timr slice, currently running process will lose one credit.
: When the credits reach zero, it is suspended. According to the above
: description, which of the following statements is correct?
"假設priority number大的 priority 愈高" <= 這是問題點
假設初始情況: P1-P2-P3 同時進入
Process Priority Credit
P1 2 2
P2 2 2
P3 4 4
根據 Scheduler 會先挑 P3 來做
: (a)this credit system gives high priority to CPU-bound processes
這要看 CPU-bound 的 priority 是高或低 , 通常是低
假設 P2 是 CPU-bound
P3 連續用了 2 個 time slice 後
Process Priority Credit
P1 2 2
P2 2 2
P3 4 2
根據 公式 新的 credit 為
Process Priority Credit
P1 2 3
P2 2 3
P3 4 5
還是挑 P3 來做...
CPU-bound priority 並沒有提高
: (b)the scheduling will exhibit short response time
由上可知 high-priority (P3 如 I/O bound)
的 response time 會縮短
: (c)interactive processes will receive fewer credits than non-I/O bound
: processes
這要看 CPU bound process 與 interactive process 誰的
priority 高 , 通常是 interactive 較高
則 interactive process priority number 較大 , credit 較多
: (d)nine of the above
: 答案有人寫 D 也有人寫 B 但我都不太了解題目意義
: 可以請高手指導一下嗎?? 謝謝
答案選 (b)
但問題就在於 "假設 priority number 大的 代表 higher priority"
是否正確...
課本裡提到 linux 是用 number 小的代表 higher priority
這樣的話...(a) (c) 都對
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.222.93