GATE / CS ARCHIVE

GATE CSE 1997 / QUESTION 74(a)

Sequential record time without buffering

Operating Systems · I/O & Disk Scheduling · Full GATE CSE 1997 paper

GATE 1997, Q74(a) 1 mark · Descriptive
Report issue

I/O & Disk Scheduling

Question 74(a), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses no buffering. Find elapsed time.
Question 74(a), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses no buffering. Find elapsed time.
Question 74(a), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses no buffering. Find elapsed time.
Tap to enlarge
Answer & solution

Answer: 17,000 ms = 17 s. (no official key was published)

One record's transfer time is its byte count divided by the byte rate:
3200/(800×103) seconds = 0.004 seconds = 4 ms.
The 10 ms access time is a separate per-read cost, so reading one unblocked record takes 10+4=14 ms. With no buffering, the program reads a record, waits for that read to finish, processes it for 3 ms, and only then starts the next record's read.

The per-record serial schedule is therefore [10 ms access][4 ms transfer][3 ms processing], lasting 17 ms. Repeating it for 1000 records gives 1000×17=17,000 ms=17 seconds. The first record's access and the last record's processing are already included, so no extra startup or drain term should be appended.

The word consecutive does not by itself remove the explicitly supplied access cost. The usual model of this question charges one access for each unblocked read; a continuous streaming device model that pays access only once would be a different assumption. Likewise, the rate is in bytes per second, so no factor of eight belongs in the calculation. The result uses the decimal rate 800×103 exactly as printed.

Without read-ahead storage there is no valid overlap between reading the next record and processing the current one in this model. Using max(14,3) per record would silently introduce buffering, which is the separate next part of the question.

Original paper, page 11