Interrupt Handling in Computer System


Let’s say a process P1 is executing in the CPU and it needs to read a file from the disk.

Interrupts Handler

As soon as the CPU receives an interrupt it stops the current execution. It transfers the controller to the interrupt handler routine (Part of the kernel). Interrupt handler routine based on the interrupt type handle the corresponding interrupt handler routine.

  • CPU has a pin which is known as an interrupt request pin
  • CPU continuously monitors this pin after every instruction execution to check if any signal has been sent.
  • If the CPU receives a signal over this pin it transfers the control to the interrupt handler routine.
  • The interrupt handler routine handles the interrupt using the interrupt table.

Final conclusion

Interrupts are used to handle async events. These events are generally raised by the device controllers and hardware of the system. The priority interrupts concept is used to prioritize the important work first. The system should be optimized for interrupt handling as it occurs very frequently.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ajay Yadav

Ajay Yadav

Believer of Distributed Systems