In computer science, an interrupt is a signal from a device which typically results in a context switch: that is, the processor sets aside what it's doing and does something else.

Digital computers usually provide a way to start software routines in response to asynchronous electronic events. These events are signaled to the processor via interrupt requests (IRQ). The processor and interrupt code make a context switch into a specifically written piece of software to handle the interrupt. This software is called the interrupt service routine, or interrupt handler. The addresses of these handlers are termed interrupt vectors and are generally stored in a table in RAM, allowing them to be modified if required.

Interrupts were originated to avoid wasting the computer's valuable time in software loops (called polling loops) waiting for electronic events. Instead, the computer was able to do other useful work while the event was pending. The interrupt would signal the computer when the event occurred, allowing efficient accommodation for slow mechanical devices.

Interrupts allow modern computers to respond promptly to electronic events, while other work is being performed. Computer architectures also provide instructions to permit processes to initiate software interrupts or traps. These can be used, for instance, to implement co-operative multitasking.

A well-designed interrupt mechanism arranges the design of the computer bus, software and interrupting device so that if some single part of the interrupt sequence fails, the interrupt restarts and runs to completion. Usually there is an electronic request, an electronic response, and a software operation to turn off the device's interrupt, to prevent another request.

Interrupt Types

Typical interrupt types include:

  • timer interrupts
  • disk interrupts
  • power-off interrupts
  • 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 timer interrupt just interrupts periodically from a counter or the power-line. The software (usually part of an operating system) counts the interrupts to keep time. The timer interrupt may also be used to reschedule the priorities of running processes. Counters are popular, but some older computers used the power line because power companies control the power-line frequency with an atomic clock.

A disk interrupt signals the completion of a data transfer from or to the disk peripheral. A process waiting to read or write a file starts up again.

A power-off interrupt predicts or requests a loss of power. It allows the computer equipment to perform an orderly shutdown.

Interrupts are also used in typeahead features for buffering events like keystrokes.

Interrupt routines generally have a short execution time. Most interrupt routines do not allow themselves to be interrupted, because they store saved context on a stack, and if interrupted many times, the stack could overflow. An interrupt routine frequently needs to be able to respond to a further interrupt from the same source. If the interrupt routine has significant work to do in response to an interrupt, and it is not critical that the work be performed immediately, then often the routine will do nothing but schedule the work for some later time and return as soon as possible. Some processors support a hierarchy of interrupt priorities, allowing certain kinds of interrupts to occur while processing higher priority interrupts.

Processors also often have a mechanism referred to as interrupt disable which allows software to prevent interrupts from interfering with communication between interrupt-code and non-interrupt code. See mutual exclusion.

Typically, the user can configure the machine using hardware registers so that different types of interrupts are enabled or disabled, depending on what the user wants. The interrupt signals are And'ed with a mask, thus allowing only desired interrupts to occur. Some interrupts cannot be disabled - these are referred to as non-maskable interrupts.

A spurious interrupt is an IRQ that happens, but no interrupt handler is registered for the IRQ.

Interrupt is also the name of a suspense novel written by author Toni Dwiggins in es:Interrupcin fr:Interruption (informatique) it:Interrupt nl:Interrupt ja:割り込み pl:Przerwanie lt:Pertraukimas


  • Art and Cultures
    • Art (
    • Architecture (
    • Cultures (
    • Music (
    • Musical Instruments (
  • Biographies (
  • Clipart (
  • Geography (
    • Countries of the World (
    • Maps (
    • Flags (
    • Continents (
  • History (
    • Ancient Civilizations (
    • Industrial Revolution (
    • Middle Ages (
    • Prehistory (
    • Renaissance (
    • Timelines (
    • United States (
    • Wars (
    • World History (
  • Human Body (
  • Mathematics (
  • Reference (
  • Science (
    • Animals (
    • Aviation (
    • Dinosaurs (
    • Earth (
    • Inventions (
    • Physical Science (
    • Plants (
    • Scientists (
  • Social Studies (
    • Anthropology (
    • Economics (
    • Government (
    • Religion (
    • Holidays (
  • Space and Astronomy
    • Solar System (
    • Planets (
  • Sports (
  • Timelines (
  • Weather (
  • US States (


  • Home Page (
  • Contact Us (

  • Clip Art (
Personal tools