ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > ZSTU class(2019-2020-1) > student directories > 2017329621011-蔡腾皓 >
homework-9 Version 0
👤 Author: by 781863542qqcom 2019-12-04 09:12:44
1.Continuous allocation

In continuous allocation, the space allocated from the disk is continuous.There is no hole in one file's address space.For example, if a file requires n blocks and is given a block b as the starting location, then the next n continuous block is assigned to the file.Given the starting address and file size, it can be easy to read the whole file.

The advantages of continuous allocation are that both the sequential and direct accesses are supported and the speed is extremely fast.

The disadvantages of continuous allocation are that it will cause both internal and external fragmentation, decreasing the space utilization, and increasing file size is difficult because the file must be stored in a continuous space.

2. Linked list allocation

In linked list allocation, each file is a linked list of disk blocks which need not be continutous.The directory entry contains a pointer to the starting and the ending file block. Each block contains a pointer to the next block.

the advantages of linked list allocation are that the flexibility is really high, the file can increase its size because the system does not have to find a continuous space.Besides the fragmentation problem is eased.

the disadtantages of linked allocation are that to seek a position, the system must access every block individually so the speed is low and it doesn't support random or direct access.What's more, the pointer stored by every block occupied some space, decreasing the space utilization.

3. Indexed allocation

In indexed allocation, a special block index block is introduced.It contains the pointer to all the blocks occupied by a file.Each file has its own index block. the ith entry in the index block contains the disk address of the ith file block. The directory entry contains the address of the index block.

the advantages of indexed allocation are that it support direct access to the file so the speed is fast and overcomes the problem of external fragmentation.

the disadvantages of index allocation are that pointer occupy some space and for very small files the system assigns a whole indexed block to it which is memory-inefficient.

 

Please login to reply. Login

Reversion History

Loading...
No reversions found.