A program reads and processes consecutive records from a sequential file stored on device without using any file system facilities. Given the following
- Size of each record bytes
- Access time of msecs
- Data transfer rate of bytes/second
- CPU time to process each record msecs
What is the elapsed time of if
-
contains unblocked records and does not use buffering?
-
contains unblocked records and uses one buffer (i.e., it always reads ahead into the buffer)?
-
records of are organized using a blocking factor of (i.e., each block on contains two records of ) and uses one buffer?
View worked solution
Answer: 9.006
First, let us calculate the basic parameters for a single record:
- Record size: bytes
- Transfer rate: bytes/sec = bytes/sec
- Transfer time for 1 record:
- Access time:
- Total I/O time for 1 record:
- CPU processing time for 1 record:
Now, we evaluate each case:
Case A: Unblocked records, no buffering
Since there is no buffering, I/O and CPU processing happen sequentially for each of the records:
Case B: Unblocked records, one buffer (read-ahead)
With one buffer, the CPU processes the current record while the next record is being read in parallel:
Case C: Blocking factor of 2, one buffer
Each block contains records.
- Number of blocks: blocks
- Block size: bytes
- Transfer time for 1 block:
- Total I/O time for 1 block:
- CPU processing time for 1 block (2 records):
Free practice · Your answers on this page are not saved.
