0% found this document useful (0 votes)
53 views40 pages

Chapter 3 - Uniprocessor Scheduling

The document discusses different CPU scheduling algorithms: First-Come, First-Served (FCFS) schedules processes in the order of arrival, which can lead to convoy effect. Shortest Job First (SJF) schedules the shortest process first but requires knowing process lengths. Priority scheduling assigns priorities and schedules higher priority processes first. Round Robin (RR) allows equal time slices or quanta for each process in queue, avoiding starvation.

Uploaded by

KarthikhaKV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views40 pages

Chapter 3 - Uniprocessor Scheduling

The document discusses different CPU scheduling algorithms: First-Come, First-Served (FCFS) schedules processes in the order of arrival, which can lead to convoy effect. Shortest Job First (SJF) schedules the shortest process first but requires knowing process lengths. Priority scheduling assigns priorities and schedules higher priority processes first. Round Robin (RR) allows equal time slices or quanta for each process in queue, avoiding starvation.

Uploaded by

KarthikhaKV
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

CHAPTER 3

UNIPROCESSOR
SCHEDULING
PROCESS SCHEDULING AND 2

CPU SCHEDULING
3

SCHEDULING QUEUES
4

CPU SCHEDULING
CPU SCHEDULING DECISION
5

Nonpreemptive Preemptive
• Once a process is in the running • Currently running process may
state, it will continue until it be interrupted and moved to
terminates or blocks itself for ready state by the OS
I/O
Preemptive and Nonpreemptive 6
SCHEDULING CRITERIA 7

CPU utilization – keep the CPU as busy as possible (executing


processes as many as the CPU can)

Throughput – number of processes that complete their execution


per time unit (measuring work been done by the CPU)

Turnaround time – amount of time to execute a particular process


(how long it takes to execute a particular process, these include
waiting for the process to get into memory, waiting in ready queue,
executing on the CPU and doing I/O)
SCHEDULING CRITERIA 8

Waiting time – amount of time a process has been waiting in the


ready queue

Response time – amount of time it takes from when a request was


submitted until the first response is produced, NOT output
(example: loading a movie from your storage, the time when you
click the movie and it runs at the background (response time), NOT
the time when the movie appear in your screen)
9

CPU SCHEDULING ALGORITHMS

• First-Come, First-Served (FCFS)

• Shortest Job First (SJF)

• Priority

• Round Robin (RR)


FIRST-COME, FIRST-SERVED
10

(FCFS)
FIRST-COME, FIRST-SERVED
11

(FCFS)
FIRST-COME, FIRST-SERVED
12

(FCFS)
FIRST-COME, FIRST-SERVED
13

(FCFS)
14

FCFS, THE CONVOY EFFECT


15

FCFS – EXAMPLE
16

FCFS – EXAMPLE
17

FCFS – EXAMPLE
18

SHORTEST JOB FIRST (SJF)


19

SHORTEST JOB FIRST (SJF) – EXAMPLE 1


20

SHORTEST JOB FIRST (SJF) – EXAMPLE 2


21

SHORTEST JOB FIRST (SJF) – EXAMPLE 2


22

SHORTEST JOB FIRST (SJF) – EXAMPLE 3


23

SHORTEST JOB FIRST (SJF) – EXAMPLE 3


24

SHORTEST JOB FIRST (SJF) – EXAMPLE 3


25

PRIORITY SCHEDULING
26

PRIORITY SCHEDULING
27

PRIORITY SCHEDULING
28

PRIORITY SCHEDULING – EXAMPLE 1


29

PRIORITY SCHEDULING – EXAMPLE 1


30

PRIORITY SCHEDULING – EXAMPLE 1


31

PRIORITY SCHEDULING – EXAMPLE 1


32

PRIORITY SCHEDULING – EXAMPLE 2


33

PRIORITY SCHEDULING – EXAMPLE 2


34

ROUND ROBIN (RR)


35

ROUND ROBIN (RR)


36

ROUND ROBIN (RR) – EXAMPLE


37

ROUND ROBIN (RR) – EXAMPLE


38

ROUND ROBIN (RR) – EXAMPLE


RR Exercise (Quantum Time = 3)
Process Arrival Time Burst Time
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4

 The Gantt chart is:


 Average turnaround time?
 Average waiting time?

39
40

You might also like