CPU Sceduling
CPU Sceduling
Concepts Presentation
Topic : CPU Scheduling and
Scheduling Algorithms
Outlines or Topics to be covered :
⮚ Multi-processor System :
• The objective of the multi-programmed system is to have some process running at all
time , to maximize the cpu utilization .
▪ A process is executed until it must wait , typically for the completion of some I/O
requests .
But in case of multi-programming we can utilize this waiting time
productively .
• When the one process has to wait , the OS takes the cpu away from that
process and gives the CPU to another process & this process continues …..
Types of CPU Scheduling :
Scheduling
Non Pre-emptive : In this type of scheduling method, the CPU has been
allocated to a specific process. The process that keeps the CPU busy will
release the CPU either by switching context or terminating.
CPU Scheduling
Algorithms :
Tail 4 3 2 1 Head
CPU
• When the CPU is free the head will be move to the CPU for
processing
• After completion the process will be removed from the queue .
• Any new process will be added to the tail of the queue .
Finding the Average waiting time as per FCFS
policy : Process Burst
Time(ms)
If the processes arrive in the order P1 , P2 , P3 and served in FCFS
order P1 24
The result will be shown as per the Grantt Chart :- P2 3
P3 3
P1 P2 P3
0 24 27 30
• When the CPU is free , it is assigned to the process that has the
smallest next CPU burst
• If the next CPU burst of two processes are same then the FCFS
scheduling is used to break the tie .
P1 P2 P4 P1 P3 P3 9 2
0 1 5 10 17 26 P4 5 3
• For example ,
If priorities range from 127 (low) to 0 (high) , we could increase the
priority of a waiting process
By 1 in every 5 mins .
Eventually even a process with initial priority of 127 would have the highest
priority after a point of time and the process will be executed .
The Purpose of a Scheduling
algorithm :