0% found this document useful (0 votes)
12 views11 pages

Tanushree Biswas... 0999

Uploaded by

Tanushree Biswas
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)
12 views11 pages

Tanushree Biswas... 0999

Uploaded by

Tanushree Biswas
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/ 11

NIT SILCHAR

NAME:TANUSHREE BISWAS
PROGRAM NAME:B TECH DS
SUBJECT NAME:OPERATING SYSTEM
SUBJECT CODE:PCC-CSD 401
STUDENT CODE 2212073
SECTION:A
NON-PREEMPTIVE SCHEDULING

➢INTRODUCTION
➢DEFINITION
➢EXAMPLE
OUTLINE ➢FCFS
➢SJF
➢PRIORITY
A scheduling algorithm in OS is the algorithm that
defines how much CPU time must be allotted to
which process and when. Scheduling algorithm is of
two types:
INTRODUCTION SCHEDULING ALGORITHM

NON-PREEMPTIVE SCHEDULING PREEMPTIVE SCHEDULING

o First Come First o Shortest


Serve(FCFS) Remaining Time
o Shortest Job First(SJF) First(SRTF)
o Priority
o Round Robin(RR)
Non-preemptive scheduling is a method that may be used when a
process terminates or switches from a running to a waiting state. When
processors are assigned to a process, they keep the process until it is
eliminated or reaches a waiting state. When the processor starts the
process execution, it must complete it before executing the other
DEFINITION process, and it may not be interrupted in the middle.

It is of three types:

❑ FCFS(First Come First Serve)


❑ SJF(Shortest Job First)
❑ Priority
FCFS(First Come First Serve)
EG:

PROCESS CPU BURST TIME ARRIVAL TIME

P1 8 0

P2 1 1
EXAMPLE P3 3 2

P4 2 3

P5 6 4
GANTT CHART:

P1 P2 P3 P4 P5
0 8 9 12 14 20

TURN-AROUND TIME: WAITING TIME:

P1=8-0=8 P1=8-8=0

P2=9-1=8 P2=8-1=7

P3=12-2=10 P3=10-3=7

P4=14-3=11 P4=11-2=9

P5=20-4=16 P5=16-6=10

AVERAGE TAT: ((8+8+10+11+16)/5) =10.6 AVERAGE WT: ((0+7+7+9+10)/5) = 6.6


SJF(Shortest Job First)
EG-

PROCESS CPU BURST TIME ARRIVAL TIME

P1 7 0

P2 4 1

P3 1 2

P4 4 3

GANTT CHART:

P1 P3 P2 P4
0 7 8 12 16
TURN-AROUND TIME: WAITING TIME:

P1=7-0=7 P1=7-7=0

P2=12-1=11 P2=11-4=7

P3=8-2=6 P3=6-1=5

P4=16-3=13 P4=13-4=9

AVERAGE WT:
AVERAGE TAT:
((0+7+5+9)/4)
((7+11+6+13)/4)
=5.25
=9.25
PRIORITY
EG-

PROCESS ARRIVAL TIME CPU BURST TIME PRIORITY

P1 0 11 2

P2 5 28 0

P3 12 2 3

P4 2 10 1

P5 9 16 4
GANTT CHART:

P1 P2 P4 P3 P5

0 11 39 49 51 67

TURN-AROUND TIME: WAITING TIME:

P1=11-0=11 P1=11-11=0

P2=39-5=34 P2=34-28=6

P3=51-12=39 P3=39-2=37

P4=49-2=47 P4=47-10=37

P5=67-9=58 P5=58-16=42

AVERAGE TAT: AVERAGE WT:


((11+34+39+47+58)/5 ) =37.8 ((0+6+37+37+42)/5 ) =24.4
THANK YOU

You might also like