Interruption (data-processing)

In Data-processing, a interruption is a temporary stop of the normal execution of a Computer program by the Microprocesseur in order to carry out another program (called routine of interruption).

In its most strict meaning, the term indicates only interruptions whose execution is caused by external causes with the program: advance of a clock, indication of the completion of a transfer of information, etc However, one also uses it to indicate exception S, i.e. stops caused by an exceptional condition in the program (erroneous instruction, access to a zone non-existent memory, incorrect arithmetic calculation, voluntary call to the operating system…). One speaks then sometimes about asynchronous interruptions to indicate those caused by an external event, and synchronous interruptions to indicate the exceptions.

Operation

At the time of an interruption, the microprocessor saves all or most of its internal state, generally in the pile system, and jumps then to the routine of interruption, generally while following a table which gives for each type of interruption the routine to be carried out.

Once the treatment of the interruption finished, the routine generally finishes by one (or several) instruction of return of interruption, which restores the saved state and makes set out again the processor of the place where it had been stopped. In certain cases, the routine of interruption modifies the return addresses, in particular to carry out commutations of tasks.

During the operation of certain parts of the operating system, it can be necessary not to allow the interruptions, either because those would disturb a tight account of time, or because structures of data are in the course of modification (one thus carries out a kind of bolt of mutual exclusion in a mono-processor system). Also, one can generally block (one often says to mask ) the interruptions. In the majority of the systems, the blocked interruptions are accumulated, i.e. they are carried out as soon as they are uncovered. However, for each type of interruption, the meter of interruptions on standby is often reduced to a simple flag; if that can not be awkward if the interruption on standby announces data on a peripheral, that can however cause bad accounts if the interruption starts the incrementing of a clock, if the interruptions are blocked for one duration higher than the period of the clock.

On certain systems, there exists a nonmaskable interruption, generally dedicated to the description of a catastrophic error for the system (for example, detection of a memory error by correct Code of errors).

The interruptions can in addition be treated on a hierarchical basis according to priorities. An interruption of higher priority is taken into account during the treatment of another interruption, but an interruption of lower priority is put on standby.

Uses

One uses the interruptions mainly with two aims:

  • in order to allow communications not blocking with external peripherals;
  • in order to commutate between the tasks in a Ordonnanceur.

Input-outputs

When the microprocessor questions a peripheral (Hard drive, wearing of communication…), there are in general deadlines before the data cannot be obtained or transmitted. The simplest solution is simply to await the data or the end of the transmission while buckling répétitivement on a test (makes an attempt activates, or polling ). Unfortunately, that blocks any program in progress, which is awkward on a system Multi-tâche. On the modern systems, one thus prefers generally an operation by interruption: the peripheral announces by an interruption that it is ready to emit, or that the data were transmitted or received, and a routine makes the treatment necessary. For the fast peripherals (hard drive, USB…), one generally combines this process with the direct access in memory (DMA): storage blocks are read or written in memory by the controller without intervention of the processor, which intervenes only at the beginning and the end of the transfer.

The use of interruptions compared to the polling allows also saving energy and a less heating: the current microprocessors generally have an instruction stopping the microprocessor on standby interruption.

Multitask

One also uses the interruptions to commutate the tasks in the multi-task systems. Generally, a periodic interruption is started by a clock (often 100 or 1000  Hz), and the Ordonnanceur is then put in action. It can commutate the tasks by modifying the task of return of the interruption.

See too

Random links:Operation Strait | Malavoi | Records of temperature | Cvetko Rajović | Castle of Chacenay | Télévision_de_réseau_de_Turner