<< Chapter < Page | Chapter >> Page > |
T = 10*(Ts + 1/(2r) + 1/(rN))
T = 10(.008 s + .003125 s + (100 KB)(60 s/m)/(9600 rpm)(300 KB/r)
T = 10(.008 s + .003125 s + .002083 s)
T = 132.083 ms
Both the indexed file organization and the hashed file are efficient for frequent access to random parts of a file. Since the fileis updated infrequently, the overhead of keeping indexes is reduced.
The indexed sequential file is efficient when access is usually to the entire file in sequential order. Keeping multiple indexes addsunnecessary overhead and the hash structure is not as useful for sequential access.
The hashed file is efficient for frequent updates, and also is efficient for random access.
Yes, it is easy to recover the lost space. Keep a bit map for every block on the disk, initially set to zero. Then traverse the filesystem starting at the root, and mark the bit mask with a 1 for every block that is used by every file. In the end, those blocks still marked by a zero arefree.
One solution is to keep a copy of the free space pointer in several different places on the disk.
The maximum file size can be found by calculating the space all the different types of block pointers can reference. First we need tocalculate the number of pointers an indirect block can hold:
N = 8*1024*8/32 = 2048
Then:
Size = 12*8 + 2048*8 + 2048*2048*8 + 2048*2048*2048*8 KB = 64 TeraBytes
The maximum file system partition is essentially equal to the size of a disk. Since we use 24 bits to address the blocks on eachdisk, the maximum size of a disk is 128 GB.
The address given is in the 13 MB range. The 12 direct pointers cover 96K, so the address is not located there. The singlyindirect pointer covers the next 16 MB of the file, so the address is in a block referenced by the singly indirect pointer. This means we will need two diskaccesses, one for the indirect block and another for the block containing the data.
UDP does not use congestion control, so all it has to do is send at whatever rate it desires. If this causes packet loss due tocongestion in a router (a FIFO queue overflowing), then the TCP flows will slow down. If UDP sends at a high enough rate, it can force the TCP flows to slowdown enough that they get nothing.
A UDP server needs only one socket because anyone can send to it on that socket. It does not establish connections to each client. ATCP server, on the other hand, needs a socket for each client because it establishes a separate connection for each one.
Notification Switch
Would you like to follow the 'Operating systems' conversation and receive update notifications?