0% found this document useful (0 votes)
10 views

CPU Scheduling Algorithms

The main function of the CPU scheduling is to ensure that whenever the CPU remains idle, the OS has at least selected one of the processes available in the ready-to-use line.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

CPU Scheduling Algorithms

The main function of the CPU scheduling is to ensure that whenever the CPU remains idle, the OS has at least selected one of the processes available in the ready-to-use line.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Dr.

Joe Prathap P M

CPU scheduling algorithms


What is the need for CPU

A
scheduling algorithm?

CPU scheduling is the process of


deciding which process will own
the CPU to use while another
process is suspended. The main
function of the CPU scheduling is
to ensure that whenever the CPU
remains idle, the OS has at least
selected one of the processes
available in the ready-to-use line.
CPU Scheduling –Dr. Joe 2
Objectives of Process Scheduling Algorithm:
•Utilization of CPU at maximum level. Keep CPU as busy as possible.
•Allocation of CPU should be fair.
•Throughput should be Maximum. i.e. Number of processes that complete their execution
per time unit should be maximized.
•Minimum turnaround time, i.e. time taken by a process to finish execution should be the
least.
•There should be a minimum waiting time and the process should not starve in the ready
queue.
•Minimum response time. It means that the time when a process produces the first response
should be as less as possible.

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

Click icon to add picture Click icon to add picture

Mirjam Nilsson​ Flora Berggren​


Chief Executive Officer Chief Operations Officer

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

ROI Niche markets Supply chains


• Envision multimedia-based • Pursue scalable customer service • Cultivate one-to-one customer
expertise and cross-media growth through sustainable strategies service with robust ideas
strategies
• Engage top-line web services • Maximize timely deliverables for
• Visualize quality intellectual with cutting-edge deliverables real-time schemas
capital
• Engage worldwide methodologies
with web-enabled technologies

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

You might also like