3. Scheduling
• Scheduling is a process which allows one process to use the
CPU while the execution of another process is on hold due to
unavailability of any resources.
• It’s aim is to make system efficient , fast and fair.
Criteria for best scheduling algorithm:
CPU Utilization : Computer usage of memory and processing
resources or amount of work handle by a CPU.
Throughput : It is the total number of process completed per unit
time.
4. Response time : Amount time it taken from when a request was submitted
until first response is produced is called response time.
Turn around time : It is the total amount of time the process executed itself
on the CPU.
Waiting time : It is the amount of time a process waits to load itself on the
CPU.
Load average : average number of processes sitting in the ready queue
waiting for that turn to get onto CPU.
Fairness : All the jobs should get fair chance to get the use of CPU.
Efficiency : scheduler should keep the system busy whole time, if CPU and
all i/o devices can be kept running all the time more work can be done per
second.
5. Scheduling Objectives
When to schedule :
• When a new process is created , a decision needs to be made whether to run the
parent process or child process.
• A scheduling decision must be made when a process exits.
• When I/O interrupt occurs , a scheduling decision may be made.
Main objective of scheduling is :
• Be Fair
• Make the system fast
• Maximize throughput
• Increasing the profit.
• Increasing the output.
• Maximize number of users receiving acceptible response times.
• Reducing the manufacturing time.
• Minimizing the production costs
• Give better service to processes that have desirable behaviour patterns
6. Scheduler
• When a computer is multiprogrammed , it frequently has
multiple process or threads competing for the CPU at the
same time.
• This situation occurs whenever two or more of them are
simultaneously in the ready state.
• If only one CPU is available , a choice has to be made
which process to run next.
• The part of the operating system that makes the choice is
called the scheduler.
8. Long term schedulers
• It is also called job scheduler
• It determine which program are admitted to a system for
processing .
• It selects process from queue and loads them in to memory for
execution .
• On some system it may not me available or may be minimal .
• Time sharing operating systems have no long term scheduler.
• When process changes the state from new to ready, then there is
use of long term scheduler.
9. Short term schedulers
• It is also called CPU scheduler.
• Main objective is increasing system performance in accordance
with the chosen set of criteria .
• CPU scheduler selects process among the processes that are ready
to execute and allocates CPU to one of them.
• When process changes the state from ready to running, then there
is use of long term scheduler.
• They are also called as dispatchers.
• Context switching is done by dispatchers.
• Faster than long term schedulers .
10. Dispatchers :
• It gives control of CPU to the process selected by short term
scheduler.
• This involves switching context , switching of user mode ,
jumping to proper location in the user program to restart
that program .
Dispatcher latency :
• Time taken by dispatcher to stop one process and start
another .
11. Medium term schedulers
• It is the part of swapping .
• It removes the processes from memory .
• A running process may become suspended if it does not get
I/O resource needed.
• In this condition the process is move to the secondary
storage until it gets the resources.
• It is the part of time sharing operating system.
12. Conclusion
• From this topic we learn how the scheduler works, and how
scheduler allows one process to use the CPU while the execution of
another process is on hold due to unavailability of any resources.