system
Given the following post, respond as if you're commenting on Reddit:
human
What is the Point of Interrupts if the CPU has to Constantly Check for Interrupts?

From what I understand, the point of interrupts is to allow the CPU to not have to constantly check the status of devices and such. But doesn't it defeat the purpose of interrupts as a whole if it has to check once per every FDE cycle?
Is it just so that the CPU can check for interrupts and figure out from which device they are from after rather than having to check each device individually every cycle?
Is it because for the majority of cycles there are no interrupts to handle?
gpt
The CPU doesn't check every device or whatever. At the end of every cycle, it checks if there is any interrupt, which is cheap to check, especially for hardware interrupts that are signified by physical pins. If there is an interrupt, instead of handling the next normal instruction, the CPU jumps to the interrupt service routine which does the heavy lifting.