作者jim055006 (好崩溃)
看板Grad-ProbAsk
标题[理工] [OS]99中山资工
时间Tue Jan 17 15:33:50 2012
(1)
[CPU Scheduling] 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.1
milliseconds
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 (5%)
(b) The time quantum is 10 milliseconds (5%)
这是恐龙本後面的练习题
我也看了解答了
可是我还是看不懂为什麽
答案是
(a)1/1.1*100=91%
(b)20/21.1*100=94%
--------------------------------------------------------------------------------
(2)
[File-System Implermentation] Consider a file system on a disk that has both
logical and physical block sizes of 512 bytes. Assume that the information
about
each file is already in memory. For each of the three allocation strategies
(contiguous, linked, and indexed). answer these questions:
(a) How is the logical-to-physical address mapping accomplished in this system?
(For the indexed allocation, assume that a file is always less than 512
blocks long.)
(b) If we are currently at logical block 10 (the last block accessed was block
10) and want to access logical block 4, how many physical blocks must be
read from the disk?
这题我看到板上有蛮多人问的
可是好像都没有很多人回应
所以我想在po问一次
而且我看恐龙解答也写得很简易
所以也是看不太懂
以上两题希望大家可以慷慨解囊一下
钢温!!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 223.143.134.206
1F:推 pikachu123:2)你可以想成 index block就像 VM的page table 01/18 00:58
2F:→ pikachu123:先将logical address除512 因为他1个block是512bytes 01/18 00:59
3F:→ pikachu123:商数就是locgical block number余数就是 offset 01/18 01:00
4F:→ pikachu123:你再去index block查对应的pyhsical block在哪 01/18 01:00
5F:→ pikachu123:加上offset 不就是真实的位址 01/18 01:01
6F:→ pikachu123:再来他要先读index block在读 data block 01/18 01:02
7F:→ pikachu123:故要2次read 01/18 01:02
8F:→ pikachu123:这跟 VM 里logical 转physical address是一样的概念 01/18 01:03