Application of Data Structure
CPU scheduling
What is CPU scheduling?
CPU scheduling is a process which allows one process to use the
CPU while the execution of another process is on hold(in waiting
state) due to unavailability of any resource like I/O etc.
The aim of CPU scheduling is to make the system efficient, fast
and fair.
Whenever the CPU becomes idle, the operating system must select
one of the processes in the ready queue to be executed.
The selection process is carried out by the short-term scheduler
(or CPU scheduler).
The scheduler selects from among the processes in memory that
are ready to execute, and allocates the CPU to one of them.
CPU Scheduling: Dispatcher
The dispatcher is the module that gives control of the CPU to the
process selected by the short-term scheduler. This function involves:
Switching context
Switching to user mode
Jumping to the proper location in the user program to restart that
program from where it left last time.