Interrupts: Introduction

Imagine that you are in your dorm room, casually minding your own business. All of a sudden, the fire alarm starts ringing. It is probably a false alarm like usual, but you do not want to take any chances, so you evacuate the building. Once the fire alarm is disabled, and the building is cleared of any hazards, you go back inside and continue with your day.


The fire alarm is not a regular, predictable occurrence. You may not even prepare for it in advance, but once the alarm sounds, you know what the appropriate protocol to follow is, regardless of what you were doing mere moments before. This scenario is analogous to how computers may behave when it comes to handling unexpected events. A well-designed computer system may not know when a specific event will occur, but it will know what to do if such an event suddenly happens in the middle of the computer’s routine. These events are known as interrupts.