Question #159: In operating systems, scheduler is a piece of code that is used to switch the CPU between the processes or threads. Is there a need of any hardware support for scheduling in Operating systems?
- No, there is no need. Everything can be done purely in software.
- Yes, only an interrupt controller is needed.
- Yes, an interrupt controller and a hardware timer is needed.
- None of the above.
Solution:
The correct answer is the 3rd one. An interrupt controller and a hardware timer is needed such that the scheduler can be invoked after every timer interrupt. If there is no external interrupt, there is no way by which the scheduler runs other processes or threads in the system.