Enabling or Disabling an Interrupt

There might be periods during process execution when it would be undesirable for the interrupt to occur. These are generally periods when the process is accessing objects that are also modified by the interrupt. A programmer can selectively suppress execution of interrupts by using enable and disable statements.

If an interrupt's event is caused while the interrupt is disabled, the interrupt is queued for later execution. If the event is caused more than once, then multiple instances of the interrupt are queued for execution. When a later statement enables the interrupt, the queued interrupts are executed one at a time in reverse chronological order.

All interrupts are implicitly disabled while any interrupt is executing. That is, any interrupts that are caused while an interrupt is executing are queued for later execution. When the interrupt completes, the queued interrupts are executed one at a time in reverse chronological order.

Because the queuing of interrupts creates substantial overhead for a process, you should leave the interrupt in the enabled state whenever possible.

The following are examples of ALGOL statements that enable and disable an interrupt. Each statement can specify only one interrupt:

ENABLE INT1;
DISABLE INT1;

The following are examples of COBOL statements that enable and disable multiple interrupts:

ALLOW INT1, INT2.
DISALLOW INT1, INT2.