What is an interrupt?

QNX SDP8.0Getting Started with the QNX OSDeveloperUser

The first thing we need to ask is, What is an interrupt?

An interrupt is a pause of whatever was going on and a diversion to another task.

For example, suppose you're sitting at your desk working on job A. Suddenly, the phone rings. A Very Important Customer (VIC) needs you to immediately answer some skill-testing question. When you've answered the question, you may go back to working on job A, or the VIC may have changed your priorities so that you push job A off to the side and immediately start on job B.

From the technical perspective, an interrupt is an asynchronous notification delivered to the processor that isn't part of the processor's current execution stream. Devices that are both internal and external to the processor use interrupts to inform the processor of an event that requires its attention. For example, a timer generates an interrupt when its counter reaches a specific value, a network device may generate an interrupt when a new packet arrives, and a serial device generates an interrupt when its buffer has room for more data.

The main benefit of interrupts is that devices don't have to constantly check for interrupt events. Constant checking (polling) can waste processing time, and insufficient polling can cause latency, since this wait leaves devices unattended.

Page updated: