OperatingSystems
October 5, 2023ERModel
October 5, 2023OperatingSystems
Question 24

Consider two files systems A and B , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50 th and 51 st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in A and B are n A and n B , respectively, then the value of n A + n B is_________.
102

Question 24 Explanation:
Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory.
For linked allocation we have to trace the first 51 blocks, which requires 51 disk accesses. Similarly for contiguous allocation we have to move the block number 50100 after insertion of a new block, which takes 51 accesses. Hence, the answer is 51+51 = 102.
For linked allocation we have to trace the first 51 blocks, which requires 51 disk accesses. Similarly for contiguous allocation we have to move the block number 50100 after insertion of a new block, which takes 51 accesses. Hence, the answer is 51+51 = 102.
Correct Answer: A
Question 24 Explanation:
Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory.
For linked allocation we have to trace the first 51 blocks, which requires 51 disk accesses. Similarly for contiguous allocation we have to move the block number 50100 after insertion of a new block, which takes 51 accesses. Hence, the answer is 51+51 = 102.
For linked allocation we have to trace the first 51 blocks, which requires 51 disk accesses. Similarly for contiguous allocation we have to move the block number 50100 after insertion of a new block, which takes 51 accesses. Hence, the answer is 51+51 = 102.
Subscribe
Login
0 Comments