Reputation: 141
I saw in an article that the operating system is interrupt-driven. Is the operating system interrupt-driven or event-driven?
Thank you.
Upvotes: 0
Views: 1029
Reputation: 14117
At its core, an operating system is going to be interrupt-driven. That being said, the OS can still utilise events.
Try thinking about it this way .... Imagine a system with a variety of threads, but at the moment there is nothing to do--that is, it is idle and no thread is ready to run. Since no thread is running in the system, the system will remain unchanged until some kind of external action occurs. This external action will take the form of an interrupt. This interrupt may come from a timer, serial port, keyboard, mouse, disk drive, network device, .... Whatever the source, this interrupt needs to be serviced and it has the potential to cause a number of threads to become ready and thus execute.
An event is a software construct. Some execution contexts can wait for events; some can signal events; some can do both. In a complex system, you may have a variety of threads waiting for and signalling events. However, at its core, the OS still has to respond to interrupts, and only interrupts will get it out of the idle state.
Upvotes: 1