What is Interrupt handler?

The routine a CPU runs when an interrupt or exception occurs. It saves the interrupted state, handles the cause and returns. Handlers should be kept as short as possible.

Field: OS & Hardware

Interrupt handler in the explanations

Questions that mention Interrupt handler (6)

  1. While the main code updates a register bit with "reg |= mask;" (read-modify-write), an interrupt handler changes a different bit of the same register. Which pairs the possible problem with a fix correctly?
  2. What should be avoided inside an interrupt handler?
  3. Why is it bad practice to kick (reset) the watchdog timer unconditionally inside a 1 ms timer interrupt handler?
  4. What is the usual sequence when a CPU accepts an interrupt?
  5. What mechanism mainly lets the OS reclaim the CPU at regular intervals, even from programs that never give it up voluntarily, and switch to other processes?
  6. When the program above is compiled with optimization, led_on() may never be called even after the timer interrupt fires. Which pairs the cause with the fix correctly?

Related terms

Interrupt Read-modify-write Watchdog timer Microcontroller Interrupt vector table Copy-on-write ASID Context switch Demand paging Device driver

Back to the glossary