Image Source: https://www.canstockphoto.com/android-operating-system-logo-on-12761409.html |
Introduction
A hardware interrupt or external interrupt is a mechanism in computers that allows external hardware devices to inform the central processing unit (CPU) that an interrupt routine must be performed to complete a specific task required by it and interrupt its normal execution of instructions. This happens when an external event, called an interrupt request, requires immediate attention from the CPU. These events can range from a user entering data through a keyboard to a hardware drive signalling that it has completed a data transfer. In this blog post, we will explain two methods of hardware interrupts: polling and vectored interrupt.
Polling
Vectored Interrupt
In the vectored interrupt mechanism, each interrupt source notifies the CPU for an interrupt by itself. Each source has its interrupt vector in the interrupt vector table(IVT). When a source interrupts the CPU, it obtains the address of the interrupt service routine(ISR) corresponding to the interrupt source's vector from the IVT. If multiple sources interrupt the CPU at once, the CPU first services the highest priority source. In this way, we can prevent CPU cycles from getting wasted.
Consider that in a gathering everyone has to go up to a table to get food served to them. No one will come to every seat. Anyone who requires food will go up to the table and a person will serve them. If multiple guests go to the table at once, the serving people will first give the food to the eldest person who comes there and then to the younger people.
Conclusion
In modern computing systems, the preference for vectored interrupts is evident due to their ability to handle multiple devices effectively. They help avoid the drawbacks of hardware polling, such as increased power consumption, decreased responsiveness, and limited scalability.
However, it's important to note that the choice between hardware polling and vectored interrupts may depend on the specific requirements of a system. Certain applications or embedded systems with minimal hardware resources might find hardware polling more feasible. In contrast, high-performance systems that demand rapid responses and efficient resource utilization would benefit significantly from vectored interrupts.
Comments
Post a Comment