0% found this document useful (0 votes)
6 views4 pages

Process Scheduling

Process scheduling involves managing the execution of processes on the CPU through various queues. There are three types of schedulers: Long-Term (job scheduler), Short-Term (CPU scheduler), and Medium-Term (swapping scheduler), each with distinct roles and speeds. Long-Term controls the degree of multiprogramming, Short-Term selects processes for CPU execution, and Medium-Term manages process swapping between memory and disk.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Process Scheduling

Process scheduling involves managing the execution of processes on the CPU through various queues. There are three types of schedulers: Long-Term (job scheduler), Short-Term (CPU scheduler), and Medium-Term (swapping scheduler), each with distinct roles and speeds. Long-Term controls the degree of multiprogramming, Short-Term selects processes for CPU execution, and Medium-Term manages process swapping between memory and disk.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

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.

Types of Process Schedulers

There are three types of process schedulers:

1. Long Term or Job Scheduler


Long Term Scheduler loads a process from disk to main memory for execution. The new
process to the ‘Ready State’.
 It mainly moves processes from Job Queue to Ready Queue.
 It controls the Degree of Multi-programming, i.e., the number of processes present
in a ready state or in main memory at any point in time.
 It is important that the long-term scheduler make a careful selection of both I/O and
CPU-bound processes. I/O-bound tasks are which use much of their time in input
and output operations while CPU-bound processes are which spend their time on
the CPU. The job scheduler increases efficiency by maintaining a balance between
the two.
 In some systems, the long-term scheduler might not even exist. For example, in
time-sharing systems like Microsoft Windows, there is usually no long-term
scheduler. Instead, every new process is directly added to memory for the
short-term scheduler to handle.
 Slowest among the three (that is why called long term).

2. Short-Term or CPU Scheduler


CPU Scheduler is responsible for selecting one process from the ready state for running
(or assigning CPU to it).
 STS (Short Term Scheduler) must select a new process for the CPU frequently to
avoid starvation.
 The CPU scheduler uses different scheduling algorithms to balance the allocation of
CPU time.
 It picks a process from ready queue.
 Its main objective is to make the best use of CPU.
 It mainly calls dispatcher.
 Fastest among the three (that is why called Short Term).

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).

 It reduces the degree of multiprogramming (Number of processes present in main


memory).
 A running process may become suspended if it makes an I/O request. A suspended
processes cannot make any progress towards completion. In this condition, to
remove the process from memory and make space for other processes, the
suspended process is moved to the secondary storage. This process is called
swapping, and the process is said to be swapped out or rolled out. Swapping may
be necessary to improve the process mix (of CPU bound and IO bound)
 When needed, it brings process back into memory and pick up right where it left off.
 It is faster than long term and slower than short term.

Medium-Term Scheduler

Comparison Among Scheduler

Long Term Scheduler Short Term Schedular Medium Term Scheduler

It is a process-swapping
It is a job scheduler It is a CPU scheduler
scheduler.

The slowest scheduler. Speed is the fastest Speed lies in between


Long Term Scheduler Short Term Schedular Medium Term Scheduler

among all of them. both short and long-term


schedulers.

It gives less control over


It controls the degree of how much It reduces the degree of
multiprogramming multiprogramming is multiprogramming.
done.

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.

It can re-enter the It can re-introduce the


It selects those processes
process into memory, process into memory and
which are ready to
allowing for the execution can be
execute
continuation of execution. continued.

You might also like