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

(NCS-206) Operating Systems: Unit: 3.2

This document discusses operating system scheduling algorithms. It covers performance criteria for scheduling like utilization, throughput, turnaround time and waiting time. Common scheduling algorithms like first-come first-served, shortest job first and priority scheduling are explained. The document also discusses multiprocessor scheduling, real-time scheduling and ways to evaluate scheduling algorithms including deterministic modeling, queueing models and simulation.

Uploaded by

Saransh Dixit
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)
11 views

(NCS-206) Operating Systems: Unit: 3.2

This document discusses operating system scheduling algorithms. It covers performance criteria for scheduling like utilization, throughput, turnaround time and waiting time. Common scheduling algorithms like first-come first-served, shortest job first and priority scheduling are explained. The document also discusses multiprocessor scheduling, real-time scheduling and ways to evaluate scheduling algorithms including deterministic modeling, queueing models and simulation.

Uploaded by

Saransh Dixit
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/ 15

[NCS-206]

Operating Systems
Unit : 3.2

• Performance criteria of Scheduling Algorithms


• Multiprocessor Scheduling
• Algorithm Evaluation
• Performance criteria - What do we want from our
scheduling algorithm?
• Utilization - As near 100% CPU time as possible.
• Throughput - Highest possible number of finished
processes per unit time.
• Turnaround time - As low as possible for jobs
from start to finish.
• Response time - For interactive systems, this is
more important than turnaround time.
• Waiting Time - minimize time in ready queue and
device queues.
• First-Come-First-Served Algorithm is the simples
CPU scheduling.
• Whichever process requests the CPU first gets it
first.
• It is implemented using a standard FIFO single
queue.
• Waiting time can be long and it depends heavily
on the order in which processes request CPU time
• Most appropriately called Shortest Next CPU
Burst First because it bases the order upon an
approximation of how long what the next CPU
burst will be.
• This can be proven to be the optimal scheduling
algorithm with the shortest average processing
(and waiting) time.
• The SJF algorithm can be preemptive or non-
preemptive, with the preemptive SJF algorithm
more properly being called shortest- remaining-
time-first scheduling.
• Priorities can be set:
– internally (by some measurable quantity or
quantities such as time limits, memory
requirements, number of open files, I/O burst-
to-CPU burst ratio, etc.)
– or
– externally (by system policy, such as process
importance, type or availability of funds,
sponsoring department, etc.)
• Starvation is a major problem of priority
scheduling algorithms.
• On a busy system, a low-priority process may sit
for extremely long periods of time.
• A solution to the problem is aging, where we
increment the priority (make it a higher priority)
for every 1-15 minutes of waiting.
Scenario For Priority Scheduling

Process Burst Time Priority


P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
Multilevel Queue Scheduling
Priority
1
Priority
Higher priority

2
Priority
3
Priority
4
Priority
5
Multiple Processor Scheduling

• Process scheduling on a multiprocessor


system is more complex.
• It is easier to schedule homogeneous
multiprocessor systems than heterogeneous
systems.
• Identical processors can do load sharing
with separate ready queues or a common
ready queue.
Multiprocessing
• In symmetric multiprocessing, all the
processors are considered peers and any on
of them can handle any sort of task.
• In asymmetric multiprocessing, there is a
hierarchy among the processors and one of
them may handle the task of scheduling
processes for the others.
• A real-time system is one in which time plays a
crucial role.
• An example is a CD player which must read and
then translate the bits into music within a tight
time frame.
• Real-time systems can be hard real time (where
absolute deadlines must always be met) or soft
real time (where an occasional deadline can be
missed).
• Real-time behavior is achieved by by dividing the program
into a number of processes, each of which have known
behavior.
• Real-time systems react to events which can be periodic
(happening at regular intervals) or aperiodic (not
happening at regular intervals).
• If there are m periodic events and event i occurs with a
period Pi and requires Ci seconds of CPU time, then the
load can only be handled if
 Ci/Pi <= 1
i
Such a system is schedulable.
Algorithm Evaluation
• There are several ways in which we can
evaluate the scheduling algorithms:
– Deterministic Modeling
– Queueing Models
– Simulation
• Our goal is to see if they help us meet the
performance criteria that were discussed
earlier.
Deterministic Modeling

• We will assume a predetermined set of data


• Given that data, we will determine how the
scheduling algorithm will perform.
• Deterministic Modeling is easy to
understand and implement but it only tells
us about the data sets that we use.
Simulations
• We use random numbers to give us a large
set of data that should be representative of
real-life processing scenarios.
• The distributions can be defined either
empirically or mathematically (e.g., a
Poisson distribution).
• Such simulations can be expensive and
more informative.

You might also like