Problem Statement
What is an interrupt in the context of I O, and how does it differ from polling?
Explanation
An interrupt is a signal from a device to the CPU indicating that it requires service. When the interrupt occurs, the CPU stops the current execution, saves state, and jumps to the interrupt service routine (ISR) to handle the device. In polling (or programmed I O), the CPU repeatedly checks the device’s status in a loop, which wastes CPU cycles. Interrupts allow more efficient use of the CPU since it can perform other work until a device signals. However interrupts add complexity in context switching and latency management.
