In systems programming, an interrupt is a signal to the processor or an instruction in software usually indicating an event that needs immediate attention. An interrupt signals the processor of a high-priority condition requiring the interruption of the current code the processor is executing, the current thread. The processor responds by suspending its current activities, saving its state, and executing a small program called an interrupt handler (interrupt service routine, ISR) to deal with the event. This interruption is temporary, and after the interrupt handler finishes, the processor resumes execution of the previous thread. There are two types of interrupt:
A hardware interrupt is an electronic alerting signal to the processor from an external device, either a part of the computer itself such as a disk controller or an external peripheral. For example, pressing a key on the keyboard or moving the mouse triggers hardware interrupts that cause the processor to read the keystroke or mouse position. Unlike the software type (below), hardware interrupts are asynchronous and can occur in the middle of instruction execution, requiring additional care in programming. The act of initiating a hardware interrupt is referred to as an interrupt request (IRQ).
A software interrupt is caused either by an exceptional condition in the processor itself, or a special instruction in the instruction set which causes an interrupt when it is executed. The former is often called a trap or exception and is used for errors or events occurring during program execution that are exceptional enough that they cannot be handled within the program itself. For example, if the processor's arithmetic logic unit is commanded to divide a number by zero, this impossible demand will cause a divide-by-zero exception, perhaps causing the computer to abandon the calculation or display an error message. Software interrupt instructions function similarly to subroutine calls and are used for a variety of purposes, such as to request services from low level system software such as device drivers. For example, computers often use software interrupt instructions to communicate with the disk controller to request data be read or written to the disk.
Each interrupt has its own interrupt handler. The number of hardware interrupts is limited by the number of interrupt request (IRQ) lines to the processor, but there may be hundreds of different software interrupts.
Interrupts are a commonly used technique for computer multitasking, especially in real-time computing. Such a system is said to be interrupt-driven.
Other articles related to "interrupt, interrupts":
... Message Signaled Interrupts, in PCI 2.2 and later in PCI Express, are an alternative way of generating an interrupt ... Traditionally, a device has an interrupt pin which it asserts when it wants to interrupt the host CPU ... While PCI Express does not have separate interrupt pins, it has special messages to allow it to emulate a pin assertion or deassertion ...
... Induced interrupt This technique involves forcing a breakpoint at certain points in a program at execution time, usually by altering the machine code instruction at that point (th ... When the interrupt occurs, it is handled by the testing tool to report the status back to the programmer ... This method allows program execution at full speed (until the interrupt occurs) but suffers from the disadvantage that most of the instructions leading up ...
... The Intel 8086 trap flag and type-1 interrupt response make it quite easy to implement a single-step feature in a 8086-based system ... is set, the 8086 will automatically do a type-1 interrupt after each instruction executes ... When the 8086 does a type-1 interrupt, it pushes the flag register on the stack ...
... Typical uses of interrupts include the following system timers, disks I/O, power-off signals, and traps ... Other interrupts exist to transfer data bytes using UARTs or Ethernet sense key-presses control motors or anything else the equipment must do ... A classic system timer generates interrupts periodically from a counter or the power-line ...
Famous quotes containing the word interrupt:
“Never interrupt a murderer, madame.”
—Walter Reisch (19031963)
“Television ... helps blur the distinction between framed and unframed reality. Whereas going to the movies necessarily entails leaving ones ordinary surroundings, soap operas are in fact spatially inseparable from the rest of ones life. In homes where television is on most of the time, they are also temporally integrated into ones real life and, unlike the experience of going out in the evening to see a show, may not even interrupt its regular flow.”
—Eviatar Zerubavel, U.S. sociologist, educator. The Fine Line: Making Distinctions in Everyday Life, ch. 5, University of Chicago Press (1991)