What Is an Interrupt? How a Processor Handles New Events
Your computer can receive part of a download while you're typing a sentence. The processor is already busy, so how does it learn that new data needs attention? One way is through an interrupt.
An interrupt is a signal that asks a processor to handle an event. It can cause a brief detour from the code currently running to code that deals with that event. Receiving network data is one reason for that detour. It's part of how the computer handles ordinary work.
The CPU, or central processing unit, runs a computer's instructions. A CPU can contain several cores, which can carry out separate streams of instructions. An interrupt can be directed to a particular core while others continue working. Linux's interrupt-affinity documentation describes how supported systems control which processors may receive a device's interrupts.
CPU Cores vs Threads
One Core Takes a Detour
Consider a network adapter, the hardware that connects a computer to a network. When it has incoming data ready, it can raise an interrupt to notify the processor.
The processor saves information about the interrupted work, including where to continue, then transfers control to an interrupt handler: code that responds to the event. The exact steps depend on the processor's design. Arm describes this mechanism in its Armv8-A exception model.
The operating system manages the hardware and running programs. Its central component, the kernel, handles low-level work such as device activity. A device driver lets it work with particular hardware and supplies the handler for that device.
- Try both Arm and RISC-V processors on a single board and compare them yourself.
- Skip the soldering: the header pins arrive already attached.
- Follow the step-by-step tutorial in MicroPython or C at your own pace.
The saved information allows interrupted work to resume, though the same application won't necessarily run next.
Do the Urgent Part First
Handling an interrupt can create more work than should happen immediately. The handler may acknowledge the device's signal and save information so another part of the driver can finish later.
Time spent in a high-priority handler is time the affected processor can't spend on lower-priority work. Microsoft tells Windows developers to keep an interrupt service routine, or ISR, brief. This is the initial handler; longer work can wait until afterward.
A higher-priority interrupt can interrupt a handler already running. Some interrupts can also be masked, meaning the processor temporarily holds off on handling them. “Interrupt” doesn't always mean “processed instantly.”
What Is a Kernel?
One Packet Doesn't Mean One Interrupt
Network data travels in small units called packets. A busy connection can deliver many packets, so interrupting a processor separately for each one could spend a lot of time just starting and stopping handlers.
Networking software can switch between interrupts and polling, which means checking whether more work is waiting.
Linux's NAPI networking mechanism provides an example. A device interrupt can start packet processing. The driver then checks for available packets and handles a batch, keeping further interrupts from that source masked while it works. Once the work is finished, interrupts can be enabled again.
Some network devices also group notifications before sending an interrupt. And polling can begin without an initial interrupt in some configurations. The details depend on the hardware and software, so a packet count isn't automatically an interrupt count.
- Make LEDs blink and sensors report in an afternoon with more than 22 guided lessons.
- Start with no soldering: everything plugs into the breadboard.
- See how code controls real hardware, the first step toward understanding any device.
Interrupts and Exceptions
The terminology can be confusing because it varies with processor design. In Armv8-A, interrupts belong to a broader group called exceptions, events that redirect the processor to special handling code.
An external interrupt is asynchronous: it can arrive independently of the instruction being executed. An invalid instruction causes a synchronous exception, tied to that instruction. Some processor designs also let software deliberately request a handler. This is one use of the term software interrupt.
When Interrupt Handling Becomes a Problem
Heavy interrupt handling can affect responsiveness. A kernel bug can also leave a processor unable to handle interrupts normally. Linux includes watchdog detectors that can recognize certain stuck-processor conditions and issue a warning or stop the system, depending on the settings.
These checks depend on hardware support. Detecting a stuck processor doesn't itself recover the system or save unfinished work.
An interrupt count alone can't establish why a computer is slow, much less prove it's under attack. To investigate, connect that count to the device involved, the work it's doing and any reported errors.
What a CPU Core Does—and When More Cores Help

The Kernel: How Programs Share One Computer

What Is a Daemon? The Programs Working Behind Your Apps

QUOTE:
"Amateurs hack systems, professionals hack people."

