Re: [理工] [OS] I/O operation
※ 引述《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
03/23 09:50, 1F
→
03/23 09:51, , 2F
03/23 09:51, 2F
→
03/23 09:57, , 3F
03/23 09:57, 3F
推
03/23 09:59, , 4F
03/23 09:59, 4F
推
03/23 11:41, , 5F
03/23 11:41, 5F
→
03/23 11:58, , 6F
03/23 11:58, 6F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):