Overview

An interrupt 'interrupts' the CPU's current task to handle a high-priority event. This allows the computer to respond quickly to external events like a mouse click, a key press, or data arriving from the network.

Types

  • Hardware Interrupts: Generated by physical devices (e.g., a disk drive finishing a read operation).
  • Software Interrupts: Generated by programs (e.g., a system call to the OS).
  • Exceptions: Generated by the CPU itself when an error occurs (e.g., division by zero).

Handling

When an interrupt occurs, the CPU saves its state and jumps to a specific piece of code called an Interrupt Service Routine (ISR) to handle the event.

Related Terms