You are on page 1of 8

CPU Scheduling

Operati ng System Concepts – 9 th Editi on Silberschatz, Galvin and Gagne ©2013


CPU Scheduling

● Basic Concepts
● Scheduling Criteria
● Scheduling Algorithms

Operati ng System Concepts – 9 th Editi on 6.2 Silberschatz, Galvin and Gagne ©2013
Basic
Concepts
• CPU scheduling is the basis of multiprogrammed operating system.By
switching CPU among processes ,OS can make computer more active
• In Multiprogramming ,several processes are kept in memory at a time.
when one process has to wait for some I/O or interrupt,Operating system
takes CPU away from that process and gives the CPU to another process.
• This is called CPU scheduling and this cycle continues
• Success of CPU scheduling depends on an observed property of processses
• Two types of Processes are there
1.CPU bound processes
2.I/O bound processes
• There should be a mix of above processes for efficient multiprogramming
Basic Concepts

Operati ng System Concepts – 9 th Editi on 6.4 Silberschatz, Galvin and Gagne ©2013
CPU Scheduler
● Short-term scheduler or CPU scheduler selects a process
from the processes in ready queue, and allocates the C P U
to one of them
● Ready Queue may be ordered in various ways
● C P U scheduling decisions may take place when a process:
• Switches from running to waiting state
• Switches from waiting to ready state
• Switches from running to ready state
• Terminates

Operati ng System Concepts – 9 th Editi on 6.5 Silberschatz, Galvin and Gagne ©2013
Types of CPU Scheduling

Preemptive Scheduling is a CPU scheduling technique that works by dividing


time slots of CPU to a given process. The time slot given might be able to
complete the whole process or might not be able to it. When the burst time of
the process is greater than CPU cycle, it is placed back into the ready queue
and will execute in the next chance. This scheduling is used when the process
switch to ready state.
Algorithms that are backed by preemptive Scheduling are round-robin (RR),
priority, SRTF (shortest remaining time first).

Non-preemptive Scheduling is a CPU scheduling technique the process takes


the resource (CPU time) and holds it till the process gets terminated or is
pushed to the waiting state. No process is interrupted until it is completed,
and after that processor switches to another process.
Algorithms that are based on non-preemptive Scheduling are non-preemptive
priority, and shortest Job first.
Scheduling Criteria

There are many scheduling criteria to compare CPU


scheduling algorithms like:

● C P U utilization – keep the C P U as busy as possible


● Throughput – Number of processes that are completed
per time unit
● Turnaround time – Amount of time to execute a particular
process(Interval from ti me of submission to ti me of
completi on)
● Waiting time – amount of time a process has been waiting in
the ready queue
● Re sponse time – amount of time it takes from when a request
was submitted until the first response is produced, not output
(for time-sharing environment)

Operati ng System Concepts – 9 th Editi on 6.7 Silberschatz, Galvin and Gagne ©2013
Scheduling Algorithm Optimization Criteria

● Maximize C P U utilization
● Maximize throughput
● Minimize turnaround time
● Minimize waiting time
● Minimize response time

Operati ng System Concepts – 9 th Editi on 6.8 Silberschatz, Galvin and Gagne ©2013

You might also like