Question: A program contains a while loop whose each iteration reads one integer from a long file of integers on the disk. The file of 3

A program contains a while loop whose each iteration reads one integer from a long file of integers on the
disk. The file of 32-bit integers is of size 64Mbytes. The while loop terminates when the end of the file has
been reached. Excluding time waiting on the disk, each iteration of the while loop takes 120 cycles on
average. The file is read using a file-read system call that returns the next integer one at a time. Internally,
for efficiency, the file-read system call reads in one track (128Kbyte) of data at a time into an internal buffer
that is invisible to the caller. When the buffer becomes empty, the next sector is read. The time to read a
track from the disk is 800,000 cycles.
(a) How many track reads does the program do using the system call?
(b) What is the total time for computation only, excluding disk IO?
(c) Assume that all the other tasks that the program is running take an insignificant portion of the CPU's
time. What percentage of the program's total wall-clock execution time is spent waiting for the
disk?
A program contains a while loop whose each

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!