作者svanavs (svanavs)
看板Grad-ProbAsk
标题Re: [理工] [OS]-Process 管理
时间Tue Oct 6 19:01:42 2009
※ 引述《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
1F:推 yesa315:恩恩 谢谢! 10/06 20:48