Re: [理工] [OS] I/O operation

看板Grad-ProbAsk作者 (石斛蘭)時間14年前 (2010/03/23 09:42), 編輯推噓3(303)
留言6則, 3人參與, 最新討論串2/2 (看更多)
※ 引述《flyguava (紅芭樂)》之銘言: : Consider a file currently consisting of 200 blocks. Assume that the file : control block (and the index block, in the case of indexed allocation) is : already in memory. Calculate how many disk I/O operations are required for : contiguous, linked, and indexed (single-level) allocation strategies. Assume : that each disk I/O operation accesses only one block. In the contiguous : allocation case, there is no room to grow in the beginning, but there is room : to grow in the end. Moreover, the block information to be added is already : stored in memory. : (a). The block is added at the beginning. contiguous : 200(讀) + 201(寫) = 401 linked : 1(寫) = 1 indexed : 1(寫) = 1 : (b). The block is added in the middle. contiguous : 100(讀) + 101(寫) = 201 linked : 100(讀) + 2(寫) = 102 indexed : 1(寫) = 1 : (c). The block is added at the end. contiguous : 1(寫) = 1 linked : 1(讀) + 2(寫) = 3 indexed : 1(寫) = 1 : (d).The block is removed from the beginning. contiguous : 199(讀) + 199(寫) = 398 linked : 1(讀) = 1 indexed : 0 = 0 : (e).The block is removed from the middle. contiguous : 100(讀) + 100(寫) = 200 linked : 101(讀) + 1(寫) = 102 indexed : 0 = 0 參考看看^^a -- 人家可不是為了你才這樣做的哦! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.198.35.85

03/23 09:50, , 1F
先謝謝^^ 但我想問e 小題 contiguoos 為何不是99+99?
03/23 09:50, 1F

03/23 09:51, , 2F
linked 不是100+1 呢? 謝謝
03/23 09:51, 2F

03/23 09:57, , 3F
因為我想的middle 是第101個block (從1開始算XD
03/23 09:57, 3F

03/23 09:59, , 4F
恩恩 懂了 感恩^^
03/23 09:59, 4F

03/23 11:41, , 5F
請問(c)linked 為什麼只要讀1次就知道最後一個block在哪
03/23 11:41, 5F

03/23 11:58, , 6F
因為physical directory有紀錄最後一個block的位置
03/23 11:58, 6F
文章代碼(AID): #1Bg1nuSq (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1Bg1nuSq (Grad-ProbAsk)