Professional Documents
Culture Documents
CPU Scheduling Part-1
CPU Scheduling Part-1
Oarqmmed
operaina em
*CPO&heduling 3 utd + incea
CP U3a Hon
PestCPo Scheduligg
CP &chedulina
re emptue Non-emptue|
re.emptue Sehedui
JA d hen procesS
cemp¥ue Schedulin
Switchs om nhin9 Sta eaa
S Aate om the Oaitin S
ready Sak
*I Jmpsa +orun a ak th
asK
EXample:
rocesS Arival CPu ur+Tim
Time Cin mhe )
B Po
16
Non- e emplue Sheduli
a SotchcS
oce SC erminmahes ,Or ProceS
he p occss
anc loeated o C P>ocess
holde he erminahd or
eacmes
Oatims Stqe.
I he >oce $s uinq, Ahen no Anenru
A oullotocd an betudecn the Cxecy-Hon the
oceSS
amplos
6
16
* CPU
Schedulipa Citeriq'-
Schedulin Criteriq
Maximize Min'im ze
CP lizahon
*Tun around Tme
hrough put a Timc
Res ponSc Timc
CPU UHlizaHon -
*
Respon se Time'
*T+A qmoun + me n Ohieh
eponse produ-d.
urnaroun imo
Trunanrounda ime i an qmoum o
time xecute a
Speciic OceSS.
tho colcula Hon ot tho otal
ime Spent Loaiting to
3e intothe
memo , oaitng n he ucde qmd
Cecui on
ProceSSs Dyration
Ariva Time
24
8
Chantt chart
24 31
PLatipa time 0
Oating time 24
ating time 24
0+24 +29
14
3
9mS
Sms
&ms
ms
3ms
fs Oms
4-mS
4-mS
nantt+chavt.
Pa Ps
IS
o
LOatina me Sta Aecution tim- (Arinal Tme
O
3-2
Pa -S: 4
Pa1S -L: 14
i++194t 0+*
S
S
Shordest RomainpaTime
ms
ms
Sms
S ms
ms
8ms
O mS
4-ms
4 ms
Chat+ Chat-
PP s
S
6Ymylq
S 98
o
Turn Around TimeCTAT) = Compeion ime - qrrivai Aime
oaitina Tine T) TAT bust Time
occsS Completion 4ime TAT atingTme
1S IS-2 13 13-6-
7-S 2 2-2-0
93 23-1- 22 22 8- 14
3
3-0-3 3 - 3
1o-4 6 -42
13t2+22 +3+6 =
Auerage
Auevage TAT 3.2
Auerag OT + 0 t 1440+2 46
i o t y Bascd Schedalina
ior
iori bAcd
Bcheduli a method
of Scheduli Proce SSes on priori In
his omeihodihe Scheduler Selechs the
he Jatk
LOerK o Per he
12
hant chaa
Ps
13 14 16
A r u a lt 1 m
R O-0 =0
4 - 0+7=11
f4 16-1-S
's 14 2t+o
in tun. Someig
H A mostl d Aor che dulig algovithm
n
mulaitaskiKing
Etampe Considor the
ollo toing alle o aa
time and buSt
ime
ue
PL,P3 and for and
wen Time quanhum
qantum 2
Sms OmS
-ms ms
2mS
mS
4ms
Cyant chat -
11
12-S+
1o o 4 6
4-2-2 2
R S\: 4
X Leuel QueuesS
Multiple -
Schedulin
In ths method
PcosSes qssianec
uoue batel on o
he &peitic opa
oce ss like he Pro ces
i i y , Size of the
memoy, c.
Erampes Con sideY th ou
our Pdoces6S under
mylhleuel qucuc Rehedulin
ur then
ioi ot 9ucu
Round Robin
Timc 9uantum-2) and qucue 2 s FCFS.
P,P Pa
1S
4
cesS aes'.
OCeSSoy i n he ogeqhng m Can be n aj
o he ollousia Shates
The
he Heo Sta às he nea Crcatcd ram
tonich stored in thc
Secondar SAoraae
Sovage.
Kead The ProceSS s
9aitina4o be
assianed o proce SSY
Ne
amitted Tevmingted
Tnteruret
Dis pateh
cucn Tl0 o
Comple tio waitfina cyent Na14
LOaiting!-The occSS Lattna-Jor Some
euent
o occUY Such as an T|o Completion
oY
ece pion ofa Synal)
1the poocesS is in un Sate andhe
rocess needs Some &outs r Cxecution.
b the oure A eld bx Some othus
hocess han he PocesS enhers nto the
blocKed
satia
ermingtd- The roccss as Jinished
CecutAon
CP qt he untime,
Pointer
Piorit
gem couner
CPU aisteYS
inormation
Aecounh n9 inrmahon
et
-
iocess Schcdulexs
Thread -
* A
A thyead is qlo called a a Pcof .
liahtuwcight pca
Thrcad Soichig docs not nced+o intcract
Loith
oponqt Atm.
Onc hread Can c a d , Lorie ox Change
Counter istrReaister(Reu
COunde| Counkr Coynte
Fles
Code Date Filcs
Code
Single thread
Plihread
Auandage
E{fieient Communication.
Thread minimige Contot Soitdhins me
EfcctHc tiathon o multi poc e
SSor
systm.
Rezoure Sharn
Enhanccd thoughput he m
Threads
Thore ast pes o threadAc
-USoY Leuel Thxcad
Kerne cuel Thread
Agplicaton
*Opcatia docsn'tvocogn2e A r
cvelthrcad.
Condext Soitch rcqustS ho narduoare
Suppov
USGrthread are implcmente b uSGY.
ST thmread
uSer paceThread
Libyanry
KernsSpace
CPU
Advantag e-
*
o Kevnel modifications needed o Sappo
hsadc
Scheduling Can be oPplicalion peci fie.
UScs
euelthvoads ad far} Create
Create qnd
qnd
managc
Oisadvatage
* I n a ypical opeqhi9Sem, mostS
m
Calls are blocking.
+hrcad Codc in he
manaaemcn application
are
Koancl &pace
Aduan
*Kernel cam Senedule mulipe hrcad om h
Same PrOceSS
different Ps ceor.
on
pisadvaniea
kncl hreadc ast
8enorally Sloo
Ccat and
+hre ads.
mana than the uML