Page 104 -
P. 104
78 CHAPTER 3 / A TOP-LEVEL VIEW OF COMPUTER FUNCTION
Time
1 1
4 4
Processor I/O 2a I/O
wait operation operation
5 5
2b
2
4
I/O
4 3a
operation
Processor I/O 5
wait operation
5 3b
(b) With interrupts
3
(a) Without interrupts
Figure 3.10 Program Timing: Short I/O Wait
complete. The result is that the user program is hung up at that point. When the
preceding I/O operation is completed, this new WRITE call may be processed, and
a new I/O operation may be started. Figure 3.11 shows the timing for this situation
with and without the use of interrupts. We can see that there is still a gain in effi-
ciency because part of the time during which the I/O operation is underway over-
laps with the execution of user instructions.
Figure 3.12 shows a revised instruction cycle state diagram that includes inter-
rupt cycle processing.
MULTIPLE INTERRUPTS The discussion so far has focused only on the occur-
rence of a single interrupt. Suppose, however, that multiple interrupts can occur.
For example, a program may be receiving data from a communications line and
printing results. The printer will generate an interrupt every time that it com-
pletes a print operation. The communication line controller will generate an in-
terrupt every time a unit of data arrives. The unit could either be a single
character or a block, depending on the nature of the communications discipline.