作者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
推 pikachu123:2)你可以想成 index block就像 VM的page table 01/18 00:58
→ pikachu123:先將logical address除512 因為他1個block是512bytes 01/18 00:59
→ pikachu123:商數就是locgical block number餘數就是 offset 01/18 01:00
→ pikachu123:你再去index block查對應的pyhsical block在哪 01/18 01:00
→ pikachu123:加上offset 不就是真實的位址 01/18 01:01
→ pikachu123:再來他要先讀index block在讀 data block 01/18 01:02
→ pikachu123:故要2次read 01/18 01:02
→ pikachu123:這跟 VM 裡logical 轉physical address是一樣的概念 01/18 01:03