I was reading about how OS works with interrupts to communicate with hardware, just wondering, if there is any other architecture other than Interrupt driven? In Robert Love’s book for Linux kernel, he says that most of the architecture that Linux handles are Interrupt driven, so what are the other ones? Can some one give examples? Thanks.
I was reading about how OS works with interrupts to communicate with hardware, just
Share
The short answer to your question is that there’s only one other model and that’s polling. In a polling model, the system repeatedly asks the hardware if anything has happened. The downside to this model is that the CPU is always busy asking and can only know about activity if it’s asking for it. If it starts doing something else, it could miss an action (since it wasn’t asking for activity at the time of the action).
The longer answer:
If you think about it, there can really only be two possible systems: polling (pull) and event-driven (push). In the former, you ask the hardware if anything’s happened, and in the latter, the hardware tells you. Put another way: the agency in the former is with the CPU/OS, and in the latter, it’s with the hardware. Since there are two parties, and each party can be doing one of two things, that means that we can only have two types of systems (push/interrupt and pull/polling), plus a hybrid (both interrupt-driven and polling based at different times or in different contexts).
One could imagine a variety of ways to implement any of the three systems, and one could count those as distinct models, even if, under the hood, they are really implementing one of the possible systems. I would imagine that’s not really what you’re looking for, though.