CPU Scheduling Algorithms
CPU Scheduling Algorithms
Joe Prathap P M
A
scheduling algorithm?
Presentation title 3
What are the different terminologies to take care
of in any CPU Scheduling algorithm?
•Arrival Time: Time at which the process arrives in the
ready queue.
•Completion Time: Time at which process completes its
execution.
•Burst Time: Time required by a process for CPU execution.
•Turn Around Time: Time Difference between completion
time and arrival time.
Turn Around Time = Completion Time – Arrival Time
•Waiting Time(W.T): Time Difference between turn around
time and burst time.
Waiting Time = Turn Around Time – Burst Time
Presentation title 5
CPU Scheduling algorithms- Criteria
• CPU utilization: The main purpose of any CPU algorithm is to keep the CPU as busy as
possible. Theoretically, CPU usage can range from 0 to 100 but in a real-time system, it varies
from 40 to 90 percent depending on the system load.
• Throughput: The average CPU performance is the number of processes performed and
completed during each unit. This is called throughput. The output may vary depending on the
length or duration of the processes.
• Turn round Time: For a particular process, the important conditions are how long it takes to
perform that process. The time elapsed from the time of process delivery to the time of
completion is known as the conversion time. Conversion time is the amount of time spent waiting
for memory access, waiting in line, using CPU, and waiting for I / O.
• Waiting Time: the time spent in the waiting process in the ready queue.
• Response Time: is the time taken in the submission of the application process until the first
response
Presentation title
is issued. This measure is called response time. 6
Types of algorithms
Presentation title 7
1. First Come First Serve:
• FCFS -simplest of all operating system scheduling algorithms.
• states that the process that requests the CPU first is allocated the CPU first and is implemented
by using FIFO queue.
• Characteristics of FCFS:
• FCFS supports non-preemptive and preemptive CPU scheduling algorithms.
• Tasks are always executed on a First-come, First-serve concept.
• FCFS is easy to implement and use.
• This algorithm is not much efficient in performance, and the wait time is quite high.
• Advantages of FCFS:
• Easy to implement
• First come, first serve method
• Disadvantages of FCFS:
• FCFS suffers from Convoy effect.
• The average waiting time is much higher than the other algorithms.
Presentation title 8
• FCFS is very simple and easy to implement and hence not much efficient.
Richard Branson
”
Richard Branson
Richard Branson
Problem-02:
Consider the set of 3 processes whose arrival time and burst time are given
below-
Process Id Arrival time Burst time
P1 0 2
P2 3 1
P3 5 6
If the CPU scheduling policy is FCFS, calculate the average waiting time and average
turn around time.
Presentation title 12
Meet our team
Presentation title 13
2. Shortest Job First(SJF):
Presentation title 14
• Shortest job first (SJF) is a scheduling process that selects the waiting process with the
smallest execution time to execute next. This scheduling method may or may not be
preemptive. Significantly reduces the average waiting time for other processes waiting to be
executed.
• Characteristics of SJF:
• Shortest Job first has the advantage of having a minimum average waiting time among all
operating system scheduling algorithms.
• It is associated with each task as a unit of time to complete.
• It may cause starvation if shorter processes keep coming. This problem can be solved using
the concept of ageing.
• Advantages of Shortest Job first:
• As SJF reduces the average waiting time thus, it is better than the first come first serve
scheduling algorithm.
• SJF is generally used for long term scheduling
• Disadvantages of SJF:
• One of the demerit SJF has is starvation.
• Many times it becomes complicated to predict the length of the upcoming CPU request
Presentation title 15
Presentation title 16
Areas of focus
F
B2B market scenarios
• Develop winning strategies to keep ahead of the
competition
• Capitalize on low-hanging fruit to identify a ballpark
value
• Visualize customer directed convergence
Cloud-based opportunities
• Iterative approaches to corporate strategy
• Establish a management framework from the inside
Presentation title 17
How we get there
Presentation title 18
Summary
At Contoso, we believe in giving 110%. By using our next-generation
data architecture, we help organizations virtually manage agile
workflows. We thrive because of our market knowledge and great team
behind our product. As our CEO says, "Efficiencies will come from
proactively transforming how we do business."
Presentation title 19
Thank you