Page 105 -
P. 105

3.2 / COMPUTER FUNCTION 79

                       Time
                                 1                                   1


                                 4                                   4



                             Processor      I/O                      2
                               wait      operation
                                                                                I/O
                                                                              operation
                                                                  Processor
                                 5
                                                                    wait

                                                                     5
                                 2

                                                                     4
                                 4

                                                                     3
                                                                                I/O
                             Processor      I/O
                                                                              operation
                               wait      operation
                                                                  Processor
                                                                    wait
                                 5
                                                                     5

                                                                (b) With interrupts
                                 3



                          (a) Without interrupts
                       Figure 3.11 Program Timing: Long I/O Wait


                  In any case, it is possible for a communications interrupt to occur while a printer
                  interrupt is being processed.
                       Two approaches can be taken to dealing with multiple interrupts. The first is to
                  disable interrupts while an interrupt is being processed. A disabled interrupt simply
                  means that the processor can and will ignore that interrupt request signal. If an inter-
                  rupt occurs during this time, it generally remains pending and will be checked by the
                  processor after the processor has enabled interrupts.Thus, when a user program is exe-
                  cuting and an interrupt occurs, interrupts are disabled immediately.After the interrupt
                  handler routine completes, interrupts are enabled before resuming the user program,
                  and the processor checks to see if additional interrupts have occurred.This approach is
                  nice and simple, as interrupts are handled in strict sequential order (Figure 3.13a).
   100   101   102   103   104   105   106   107   108   109   110