Assume that
the maximum capacity of a file system space is 8TB (1TB = 2
bytes), and the disk block size is 2KB. The file control block (FCB) containsan index table of 512 bytes.
A
nswer the following questions:
(1) [4 MARKS] Suppose that the index table only adopts the direct index structure, and stores the disk block number
s
occupied by the file.
How many
bytes
are required for
each
index table entry
to represent a disk block number
? What is the maximum length of a single file that can be supported
by thisscheme
?
(2) [4 MARKS] Suppose that the index table area adopts the following structure:
the first 8 bytes (
0 ~ 7
)
use <start block number, number of blocks> torepresent the pre
–
allocated continuous storage space during file creation, in which the start block number accounts for 6
bytes
, and the number of blocksaccounts for 2
bytes
; the remaining 504 bytes use the direct index structure, and one index entry accounts for 6
bytes. W
hat is the maximum length of asingle file that can be supported
by this scheme
? In order to maximize the length of a single file, what values of the start block number and number ofblocks should be set at?
A
bank has
4
service-windows, and 2 customer waiting rooms each containing 30 waiting
seats and a number machine that can be accessed by only onecustomer at a time
. When
a
customer arrives at the bank, if there is an empty
seat in either room
,
the customer
will enter that room and pick up a numberfrom the number machine in that room and then wait for the call
of a service-window
. The two number machines are controlled centrally and issue numbersin a globally increasing order. When
a
service-window
is free, it
calls and serves the next
customer. The activities of customers and service windows aredescribed as follows:
Process Customer
{
Get a waiting seat;
Get a number from a number machine;
Waiting for a call;
Access to services;
}
Process Service-window
{
while(true)
{
Call a customer;
Serve the customer;
}
}
Please add the necessary semaphores (wait (), signal ()) operations to achieve mutual exclusion and synchronization of the above processes. You should give the complete processes of customer and service-window respectively, explain the meanings of the semaphores and assign initial values to them.
Reviews
There are no reviews yet.