Process Scheduling
Process Scheduling
Process scheduling is the activity of the process manager that handles the removal of the
running process from the CPU and the selection of another process based on a particular
strategy. Throughout its lifetime, a process moves between various scheduling queues,
such as the ready queue, waiting queue, or devices queue.
Process scheduler
Categories of Scheduling
Scheduling falls into one of two categories:
Non-Preemptive: In this case, a process’s resource cannot be taken before the
process has finished running. When a running process finishes and transitions to a
waiting state, resources are switched.
Preemptive: In this case, the OS can switch a process from running state to ready
state. This switching happens because the CPU may give other processes priority
and substitute the currently active process for the higher priority process.
The dispatcher is responsible for loading the process selected by the Short-term
scheduler on the CPU (Ready to Running State). Context switching is done by the
dispatcher only. A dispatcher does the following work:
Saving context (process control block) of previously running process if not finished.
Switching system mode to user mode.
Jumping to the proper location in the newly loaded program.
Time taken by dispatcher is called dispatch latency or process context switch time.
Short-Term Scheduler
3. Medium-Term Scheduler
Medium Term Scheduler (MTS) is responsible for moving a process from memory to disk
(or swapping).
Medium-Term Scheduler
It is a process-swapping
It is a job scheduler It is a CPU scheduler
scheduler.
It is barely present or
It is a minimal It is a component of
nonexistent in the
time-sharing system. systems for time sharing.
time-sharing system.