Unit -2
Proce Be Management
P;
receze =e am executim of & program. Applicakon cmtaing
m
ony procepace that operate Comearrentie amd inkrack amon
thumeelves jointly achieve @ geal. recepe management
includes creating proceszee 1 fa pilling nepource requiremmte ,
dohudu ling them fer upe of @ CPU, implementing, precese
dyndhronisakon 4o umbro| their inttrachiome , avoiding dead locke
amd krminal. thum after their operation.
Proceeges &§ Programe
A per
Progrow ie paceive only amd dow not pt
by ited Proceep it exewkon of progr” & ackally performe
Specified ima pregrwn:
pregrers P 4 dinwee he
form achone
ackme
ww 08 exerts a
Let ve Conpider
pear: [fie Loge t
ile info 5 <=
ink we | ine [I — earn ere
open Cingo,"re0d ); | tien]
while nok data avea § |
end-of-file Cinfo) | {cow Ly pad ?
vod (info, ilom) ; —
| Print 5 Progrown P & abphact view of ite
| hop
Lie - J exeastin ,
'P’ gntoine duclavaton of file ‘info’ and variable ‘item’.
The gtatemmbe thot suade value from ingo upe Hum +
perpem pome coleulahiona amd print veoultdata avea and. lack valuep for-form
Tretructiong — upee
the inghuck ones dato area omd ptack
the imlended — Caleulalame
Conptihake te addyepe apace «
address apace,
The 08 allocate, momory bh
allocater printer to print
accomodate Pe
beloeen executumn ¢ P om
The nepulle , OS phavee — the cru
OHwy programe through Adudaling
Peon “An execulium ci a
Hence proceet cam be
allocated 0.
pregron veing
mepourcee
Al proceee Conpiote oF & Componente
(Cid, code, data, stack , nepourcee + cev eta)
where
Td = Unique TD aariqns by 08
of the pra
in the executim of the pron
omh procedure
cedepe ee Codat tex)
dota» Data uped
Containe parowelere of chloe
Colad during execution of the pray”
theiy return addreppee-
allocated by 0s.
amd gonrot purpece
am. amd
piack >
Apources 7 Sk of resource &
cPu étab > Content
regi pee
P30 rugiekre
¢ the CPU.®
P.: ? a
roceapes thot exiat in the Auatm at sme hme ave
Called = Concurrent preearee - Gnusrrent procepacs roxy
Ahare their code , dota amd nerourcee with dther
proceneee and com vhteract with one amothey during
Hheiy exeustion.
Child Procep pee
The kernel initiates an executim of a predram by
Creaking a proces for it, thip ie known ae ‘Primary Pen
The pritnory proceee Com make byte calla te creak other
procepete. There process become child proceasce and
proceay bewmu ther parent. & child procear may
primary
Create m. This parent - child
gulatenship com be
howing primary proce
inherit pome of the muse
additonal nesources through Aashom call .
other process amd be
im the ie of preceee tree,
nepraunld
A child proceee com
ew ity ook.
urcep allocakd + parent preceae
or com ge eome
e or more child proceser amd
work + each child proceanee
within om applicatim
A proceee creates
apoigne pome { ite
Thie ia known Oe multitog kingi)
Relakonghipe -behoeen Procepnee ama Programe
During exeachon of a program, ambrol flmop behorem
excautim of fumckion or procedure bared om logic of preqe
C
os mly dow acho based om Ayplom colle. Hence functions
eh program moy be beparak. proceoee , or they mo be
Code port of ae
o kind of vdlatonghip Com exit behoeen proceae §&
ingle proceee -
Too
programe -
x One-to-One Relakonghip : Lt exiete whn a aingle exeustion
of & geqpuntial prego ie in p
5 TE exigh behoum mona proces
in too Capte.
ragenhe
* Mam: to- One Relat onghip
amd pingle prearam
= Momy erecting of @ progr my be in pragreee
at the pome Hime.
ystems call
a. program reee make
(oda should
7 During exeastim,
do raquist tak —Aapeipic part of ike
be executid Concurrently ie. 0 @ peparak.
ackivily o ceuring at the ome time. The kernel
dete up exeartion & the apeei fied part of coda amd
treaty it oe peparak. preceaes The new proceee amd.
proce Peprownting exeushin of Pregrovm will have
-fo- one relation chip with the program. Suh a
program ip known Of Gonusrrent program .Benefite of Child Proceapea
Bune file Explomabion
Computation Achong will be performed cmosrrontly
See create, child proceasce. TH may qeduce the
dusakon ive, rumning Hime of Phe application
when it
Prioyihy ie A child procese that performe re he ken
Cribeak fumctione mon be aepignd high priority. Tt help -
nnect the vealkme veqpirom eonte et om
application.
The kernd oborke & child proceee ifon
evroy arigee dusing, ike operation. The
patent proceee ig not offeckd by the erroy,
it mor be oble perform recovery acho.
Gatarding
parmt provee
agaimek Errore
To facilitate uae °F chitd procaen , the karne provide
operedizne ie
G Granting 7% dhild proceae amd aeeigning priovibee tit
adhild proceee
a dild proceee
2. Terminokn,
Determining te Atatus of
3.
aken amd ayncore nijahion
4 Sharing, Commumic
behoeem
proceeee b-Ernmp
A veal me date legging application neceiver dato.
Aan lee prow a patellike ak a vote f Soo Aownples per pound
amd Abr them im & ‘le, We areume that each sample
arriving yom the pakllite ie ps into @ Apecial veg eke
¢ the eee remerg process yj appli cake,
known ae “chat - logger, jroo pexjorm follasing frre chon,
a Gpy Sei, orm ple fr om the apeciod vegiete imb yownor:
2 Copy the Bample fm memory im a file.
c Pex tos pome omolypie of % comple amd nerd ite
nuult in amotney file uped fe fature preceeeing..
Procepp tree ome proceener ay
On as)
Ne. +6
Qo
datalogger Irom Hhree child processes - 4. Copy- eample Dre eordpay
0
running
24
eULYe |
and according !4
oi fromitiom ie couse by tne occurence of beme
the plaxt OF md of om Flo operation
He dakermines ‘Fe inpluunce ackvitiee
chroma tre prob 4 om
preceee:
blocked > neady
numning on tad
turning 7
a
blodked
foendarmentad Stok Trampiion fey % Preceee
Dacrerighon
The procese it dinpatduc . The CPU beging or
neumee exeustiom of ite ingtruckione
A regret smads, by the precee in gros
or om event fo whidh ik war woikng occa
The precere ie prevmpha becaupe the kerneh
dacidie & pdudul. — peme othe proce thie
eithy becaupe O highy
Hrompiin oceure
becomes ov
priovi ty proceee
the Hye plice of te proceee
becompe
elopecd-
The preceee operaken rmokes
Aggie colt indicote thok iF wighee
to weak unkl etme yepsurce equate nada.
by ik ie grnks ar unbl a. apesfic
wont ocusye it the pape « Fivewnojor
Came £ blocking aie* Procepe suquunta am TF,
que jo operaluon
K Proves equate Q neource
© Proceae wigheg te woit for Apecipired imkyval of
time
a Procepe waite for ome acken by amotner proceae.
Tumming > krminalid — Exe cubin of the program ie compl etic .
for preceet Hrminotkon are
% Belp-Termimatio > The proceae im operation either completa
itp tagk oY realign thok it comnot operate ‘yncamins
Fes Oe haere Gee kon
atint date. or inability
Five pr imary suas one
amd Woke
moy be du + incorrect
data in a duived manner
oy incom
+p accebe
Ey Lncorrect fils accese — privilage.
* Terminahon by o parent : A procese make a Hrminc i
child proceee P; » whem it finds
yon coll to derminok
that execuhim ¢ the
necmory OF meaning fi -
% Exceeding Reource ubiligakon = fin 03 may limit the xrourcta
that oC procese "eH amauwne. A precese exceeding
would be aborkd by kernal.
operakmm: &xeuskion of am
inghuchon Jarithmebe
a) longey
child proceoe P;
yerource — limit
4 Pionormal — Candibiong uring
imtuchone » privileged
or memory prokchion violation
the kernd.
invalid
Cendikors like overfiew |
Com bead to abortion of preceee by
€ Incorrect inkrachon ith ottuy procenes : the kernal
abort a procese if a gu involved in a daadlock .The below figure Ahawe fundonumtat atat. tromition @
of O process - fl new proceae ie pus in the ready plat
afr yerouscts required by it hove been allocahd .
Tt moy a blocked, amd ready stats 2
number 4 fimeg, quenb duscribed in above
Yoble. Eventuohly
wend:
ap a nuudk of
i} entre inte ferminoked tok.
> ee
( : } pletion —_ Ts
Regource OY
wait veqpert
koe f°" a proces e
Fumdormemtal Atak tromviCompichy Hu fime Ahaving ister | which user the ime plice
of tome Tt Gmlaing too procene Pi amd Pr: PI hon CPU
buret 4 Is me followed by om T]o Operation that lash fev
e2 hos CPU bunet 4 gome followed by om Llo
loo me
operabim Hat lash fr gomp. The fable iVtustratia aed
ae during th
Timing dha! along, with Bree ee t
ope vabin of eyo
7 —Nuw8tatis
tea Event __Roeo
7 - a
Pl ie pduduled =
10 . umnin 7
> Pl ie preempkcl PL ip pdreduiled wody vt
e i nin
is Pa ig preemphd PI ip pdudulel —-Yunning a
s @1 plovh tio Pa ippdbeduled — bladed Yomnning
ewer . bided. ready
po ie pduduled blocked yumnin:
bs 3
Pr etarb flo . blocked blocked .Supponded Precenace ®@
ata to ducribe the noliare
A kerma reede additional At
of the achvily ct a proceat thot i@ not in me 4 the
four fomdamont a ptatin ducribed earlier. CGmidir a
proceee Hot woe in the msody or the blocked stab.
When it ar pwapped out of memory whin tf ie neithey
in ready nor in blodked etal , the kerwh nade to afin
muo ptab - 1 are known aa Auapndsd P
Such procese yoceape
should not be
indicata thal = hie procese
period of Kme,
odrsdabing fer a. ppecific
become Auspundsd procese:
Tf a uy
Cenridured fp
it foo would
Suspended proceee
se wor puspended +
when
aekvity- The ken mon hifi ne rome Burp
amd put Auspunded proceee ino appropriads Auapunded
probe
du w comida pwopped process amd two puapendich
‘ “plodked prone
At abn col ‘neadsy Awopeed amd
The ptabp ond prot bramitiong are ghown 19 below
fx fev tuo awapped stataComple iam Tevmmineba
Ramnin
in 3
pon Rugurce ov
wort requus
Preemption ;
Neo Ready | Rewurte qrombd
pre Bh ea emp |)
soap :
Swap-in Swup- | Swap -in
al Pe at
\e
(Coady |, Remurce gronka_{ Bld \
cette, or wait Complekd | rangped)
The — tramition ready 7 ruodsy ewapped or blockek —>
e wap - out acho. The Tevere
bledked pwsoppedt ig Lomaed by
fin takes place when the proceae ie propped
ptob tromi
back int the momory The blocked b warped =
peoopped bowitim take place if the request fr
which the proceee wor wailing fe gramtd wu while
proceee ip in oe Aus pended Akoke .
En: If Me resource fer which a proce or blocked ie
a Oe Ae the proo™ Gmknua f be pwappedt
8 her it Jt swapped back ino the mumory , ite
ik Competes with other ready
our. ©
piod- roma fo ready amd i
fr ee
stot. 8 in the ready ewap ped ptak
& awailabi iby ¢ memory
proceee nr pur either
process
im the
dapendlingifrocege Conley ueaing Proceay Control Black
Kemel’@ view of & preceae Gamgiph of Hoo parte
x Cod, data and gtack of the preceee » amd information
Oe te reer sce Oly are | auch an fle
llocakd to it.
yelakd t exeaiiim of program , puch a0 precee
* Informakon
dhe ptack pointer
ptab, CPU grate indiading
are Cmiained i” the procese mitt amd
helpe &
The feo parte
))_ thig arrangement
e Umtol block (Pc,
the procee
preeeee ydwom t ingormation by other 03 Convanivntly
Process Gonkext
= ol
I
[Seql a
I IE J [Preece it
Memon i Ae va
ips ee Ge ar
ate Te Paink [==] Gees converte
1—] fe value
lr —
Procege | ] J i
Conk, t {i |
l cal aaiat Stack Process Control Block (#8)
The precese Conkxt Conaiate of the follewin
4. Addriap Space of the preceag ! the cede, data ond Hrs
prack Componente of the preceee-
Tnformatin Ceomcerning
used by ae
allocken infermaten =
mumer reap allocated fo a proceae
momagunont umit [Mnv] during operahion
2 emnory3. 8} " '
alus { file preceaaing achvibea : Information odouts
file being uped , Auch ar curront posittma in the file.
4 ;
Procepae intrachon information : Informatio hecenary to
Contsol inttyactinm of the procese with other processes
4: ide paront amd child processes amd inktypreceee
eee
£. Ruource information © Tnformation Gemcerning Susurces
allocakd to the process
Repaired be operation of proceae
6. Mipcell omeous imformatm:
The informa om Concerning, the surources allocated amd ib
other proceser
uk the life of ne proceee-
ie maintained in tre proceae
inkrackm with
08 creak, %
Conk t througho
preceee content by allocakng mumory 4o the prowegg , loading
ne proceet coda in the allocaled rnemary md Being oP
e
ity dake ppoce:
Procege Canbol Blok (PC8)
| 7 Procespid.
| Procepe State
| Gre conenle
| pc value
Proceae Gambro! Block
(rcs)(©)
Pee Comaiph 4 three kindo of information .
* dunk fication in formalin pudras the procese id, id
ib parent procee amd id of wer who created it
* Process Atak. information bad on ib Uake, Contin f P90,
omd geal - parpeee nagiekre Core]
* OHur im formation puch aa priorily amd ib inkracton
with other proweees
Fields of te Procese Conbrol Block Lecé]
PcB Field Content
Process ih «= The unique id amignd 4 the proces akib
Creat.
procen Byrchronigah on -
Silat cients (eet gat aed fer PT EP dbl procese
typically her a prom bh
Jerminated -
Priority Te ig a numeric vadan Ov fe procen ak ib
creakon. The bern may change privity damnamicall
boreh on Nature Ccev/s0 Bound ) , oge amd
Yrnourca conumed by it
Procen Stoke Currnt Slab. of Me preees
The Pw Tmage will be reloadad afke Completion
3
oe of blocking oy prompHien ty rnume operadain of
tru proceoe-
GPRe Gantt 4 GPRE whon the proces loat got bloded
or wor prevephd
Event Tngormalion Foy a proven in the blocked p tate thie fidd
Gmlaim the ingormakion vegarding Hue went for
which Phe proces fe WaihngSiguah information In i
formation Umcesning locating of ar
homdlere 3 t re
ce ‘i i
pomky Thie fred ig used to ferm a ligt of PCBe
fer ddduling purposes.
Gontext Save , Sduduling amd Die patching.
Cont goue erforme Hawekesping Whenever com avant ere
It pave the cru ptak of the ink rruphed proceae in ite Pcs
Ttreupte procem would howe bem in the Turning ptat before
6teuvamce 4 out, the Gonkxt pave fonchon Chama ibe gtot to
Steady. The event hondley mar change Hae process tok
“blocked” if the current avmt war a seyeat for 2/o inikation
by the interrypkd proces iteelf-
The Bohudubin fumetion uses the procene prot information
rom PCB, pelect a ready proce for exeahinm amo
id to the dis pat ching frnctiom.
ab up the Gmiext of the chetel
poke up e
gmd loads the Boek
cpu. To promt lone
pane ih
The dapatching funchon
yoceee , choco ib grou cee
cru prob from ip PCB into the
of prokcken , ik pluck the addres tramalakion bugfere
uped bY the memory maraagument omit Camo]®
Eg: A
gi An 03 Gmtoin ho
ine foo procemes PI
halt : e § Ph. vith PL
eg highs priority. Lue P2 be blodud inom J/o
opera and PI ik ramming. the pollssing aches
take place whem the to Complelion event ocwra
ov the flo operation of P2.
4. The Comkxt pone gurckon w performed +" P1 amd
ike prob it chomae d fo ready
the duu information fda of FCBe the went
L. Ueing
handler finda that the Lo eperahim war inital
by pz, go it chomges re ptabe of Pt fer blocked 4
seody
it hon higher priotihy.
3. Sduduling Julich P2 0%
wu. P2"e prot it chamged fo rumning & ikie dispatche
Proce Switdring
in 1,3 amd 4
Tn above example aprocun switdhing Jrappune
yp when o
fpenchiome- Switching of prom” abo
sumning proc blocked -
dow not lead to pwi
either
euuy
became
The wont tdi behoem procones
if gousrence of the wet
promi tion enly
thol q the proc
oy
y Cou ma procs whope
prioviy on whope operabin
ip interrupt
2 dow nok Cause
ip lower thom
a by the went
any ptot. tromitionIn casei th Iudul
- : ae 7 ng fanchen pedlich inkrrupkd preeen
0 i . a
My for dispatching. Tn cae 2 te scluduling rund not be
dime at all. the dis patching firnction Aimply chamges the
Btob ¢ process back to “Mumning amd dispatch tt.
Switching behown Hu procenes abso reer pwitching the
Cenkxt. Proven Busitdhing overhead dynes om the
ptat information of a proceae -
indirect overhead aa well.
proces
Bie
|
Precen puitcring
The nely poudulid proceed mary vot Jrowe omy pax! ¢
ile address ppace in Hu cache amd go it may preform
poorly unk! it builds pupticimt information in the cathe
dhoa pome
Event Homdlina
— J
The following wk ocuy during the operation of an os.
4. Proceap creaken went = A new procen it creakd
Herminolion ouont: A proce complete ib opraken
2. Prowm
The tmerv imerrypt oceure
Procegy makes a rerource requsl
A proce veleares a musturce
3. Timer wont =
1 Ruwurce veyaat wank >
5. Rucurce release wont
6 Blo imikiahen requnt unt: Precen wighes # imitak ow To opr
4.1/o compl chien ewunt: fm 2lo ope rabin Completis
2. Menge pond eet =
yeceive event !
A menage ip dent by me precee & amottey
A meapage ruceived by 0 proce
pigual ig bent by me precen * ameter
ig ruceivecl by precen
9. Menage
igual pend went A
a 3 pucive wont: fi rignal
ib. Be programe interrupt: The current ivetrachm mal fw tions
Ai hardware mel fucken wont? Gmpaby Nardware unit wal pomchonyEven! Genbo! Blok (ECB)
the kernd must peardh the
PCB 4 alk procespes.
who om wot ercure,
wut informahin fide of the
4 pdwmen # bperh up this pres Event
03 ww differen
Gmtro! Bloke (ec) ore me ¢ Hrs poumes -
—Evont Description
Process id
ECB poinky
Event Gmbvol Block (€c8)
ECB Cemtoim three fidds, the wont ducripion pied ducribes
om wont, the preceee id fidd Canaied f id of othe preceee.
Gunaiking the wont. whun tre prec Pi a” blocked fv
greuremce ¢ om went 6, He kernd fore om £6 amd pubs
aulwomt im forme Gmncer ning e@; amd Pinte it. A kernal
a btparads Eee let 6% cach dom wonte
Llo optrokone,
Gam maintain
po the
meppagee oF
9 creatid ECB
like inbey pracee?
df mky te newly
gts ig Use
ob lint 9 ECBe -
tee kernel econ the Oppropriade kat
ha vwoat hing even duacsiphion.
ECB pointe
into 0” appro p!
wh om wot OCHre,
Ete of find om E68 Wi
id fide indicat which proceae ie bathing Jor the
hu proce
he plot gf rocepe te drama cd fo t
thin ‘ ong’ nt eck
wont to OMUT.
tr. OlUbsrmce d the wut.Gmmunication and Synchro migabion bow — Proceages
Shaving,
icahon need t inkyact with one omotnr
Procegpes of am opp!
ay thay work Boards a Gomme grt: there are four Kinda
f proceee interachon
Kinde Interaction Dercripken.
Data Sharing Shared data may bewme incemaighent if
Hu data ot the powme
Aweval proceeey modify
time. Himce procemes
duetde wh it ie eafe fre
or use shared dake. Only me p
shoved danke ak amg Hrmey Renee
hawe fo
uot interact to
prowet to rood: fy
vouun ehould
acceap
the dots acctae in ene prow ‘mo
be delayed Tf motu Preceee oeecee ing
dota. Mie ie collid mutual exclusion.
Mupage Paging Procem exchamge information by pendi
geen
meapage to ee ‘amothey. The othes proceee
Com copy the information into ity oon data
prruchavee oma ase iE. Both pondis amd receiver
aunt omnbipale the date exchomge
Synchronize on To pee & temmm gee! | proceepen aaae
at their achvites amd perform their
in adupived ovday. The proceae
om a; ip mack b
omother proceee performs ackiong
Coordin
actions
that wigher
wait umbl
+ peje ack
Signals A pignak ip und b Corvuy grecuvmee fo
exceptional pituahin & procepe. Th Code
hak proces yo Haak wigha fe exeouk, on
auceiving O pignal te cabled & digual homey@)
Threads
A ppliccahone tse Gimeno) processes te ped op the
will be long dus
i
overhead haa
overhead
operakion. However pprocen paitduny
Proven puitching
large procese plate Tnformatien «
two Compememt t
x Sxccution velaled overtuact + The CPU plod. ef dhe Yummy
proceay has bbe sowed yok the CY plals of new proven
has w be loaded
x Reource-upe ulated overhead 2 Proceap Gandexd pwrildring
‘
involve awilding the im formalin obowl neavurca
ollocokd fo the procese-
rogram thal uaa the nuova
qhued ty om exenttim if
toroagn en colt
A procene creaky a thread
of a preecet
Ty dow not howe Tunourcer 4 ib own have no amlent LA
ww the cmial of rocepe amd accepper Ihe Pasources
“pacont
{ the proeeee "Threads ; oO poe anh
com be used tp ducribe ‘the nulakomphip
ef thread”
a thread ome He prneae gach child prom
through it
greece
Joctoren
Com oreode thread fv achieve Gmoarrenct
Figure below illushala the yelalionship behocon Threade &
procene pi hor three ios implemontalion
arranger indhding camiort ome rcB «J proceee p, obo
o i eveualio
Can be don in fyare Bach Ihseadk { Pr ip om ohEeMEN
eon flack amd thread
at hha ite
fap. beackpregramy 2
Control blo [108]TCB ip pimi » P
Bip pimilay ft PCB omd purer filroing information
4. Thnead tduduling informaiton ~ thread id 1 priority and Hab,
2 Cpu ptab Conjewds a3 PB) omd GPE C
3. Punks t+ PCB parent procepe
4 TCB pointer, which i¢ wad t woke Ligh 4 TBe f ededalir
Pruceey i ———.,
e PCB Thready Comb
vecere procep F, blocky (T¢8p)
in two parte ths route
tobe
do pplite the proceee é
tt eu ptob. ip appod alc
Ups d terea
: i é, phile Cl
prod. remoine witn the process 0
win thread. Tne cont { cmnoxerunys ie |
cath dared. The swource bake
ching Joetwren
ri
unt ruplication
df the cxewstion pode fe
( Vicohd nor poitched daring busi
ip neither ttn
of the precie’
Hora dp
fee] (ay 1
ide aye i] ]
Clienb : bana
Multtiradd peg GHThread Stalis and Stal Tnampitiony &
Only difference behocon threads amd proceed igomly threads
are not allocakd with the swources. tmce threads omc tabi
amd plak fromitiong are Bimilay fe procm btah amd atat.
tramgitiong tohm the Apsead ip creakid it ie pul in the ready
Atak because lp parent proceee Already hag Necespary
nepource allocakd & ik. Dt take & Yumning tad. ce it
duspatched 1+ dow not onks 40 blocked pak became f reoure
sugpeet aA it clocs noi make omy usource raqqest Tt may
entry to blocked tat. dur 4 process ayes enigabion reqpaivomer
Advamt ages 4 threads Over procespen
Advamtage Explanation
Lowes overhead Thread Cemigh only Probe 4 computation. Resource
of creahen § alloca omd Commumi cation tak are not a part
pwitdhing of thread atot.. Hence Hhrtoda imoar lower Overhead
More ffciont thveade of 0 preceee Cou cemmumicote With ene
Commum ication amothey through Bhared dalor , true it onoide
the overhead of ayhem calle fpr cam revon cart ov
Simplifrcaton Upe d Hrveads cam Airmplify design ameh codin
qn. reat that Bere equate Ceni r
of dusign 4 arp! catone rvice vequate current
qeceived om nese Buch
Pepplicaton thot — Pervice requis!
gwesvation OF bamking Ayptome
called cliente - veg threads d impli fies
are cold servers
on aitline
dpeir usere OFF
duign thread.The perver
Below figure Mwshraks airline Mwervation ae
pervee thm
made by the chien om
rf peeral guqpuato are
would have fe we
omitrp the sequal ¢
fe after the Othey in @ qpeuke
fo be arviced — Cmncurrent the perver
Coonple® logic 4p pitch benmem the processing q veple
In cmbost, & mublithreaded perver could creak 0 uo threac
do Aervice each new requist i} neceivea amd Hominak the
tovead oft gevvicing the regquat Gancusr ny ve implicit
on ite Creation of threads. Figure phowe yulkthreaded pexver
with Hnre Hireade 8 ft har suceived thyce rugpuele
Creaken amd 4ermination g threada ie emmy tham Creakion amd
but tte overhead Com of fect the
ttamimnahen 4 proceeee,
plyporrnomee of the pervey 6 climb make requeat at very
high not. An asromgeraont colkd thread per! cam avoid
thi, overhead by reusing Aneeads imkad af chahouing
then ofhy pexvice. The thread peed. comiah 4 ome pri ma
Hnread ann fe vor
moaintaing 2% Wel + pending rugpnte
worker Hhitads. Wha New re tia made, it amigna
veqpust fo am idle worker thread if it exigh, Elpe veque
untere onto pending xequst ligt
key threade, The primary thread
and a liet gf idle@
Whur a worker thread Completa aenicing 4 nequast , the prima
Head cithey appigne @ new vequnt do the worker thread |
to pavice or emkxe in the ligt 4 idle worker thread.
The OS Could noni cag vary the number 4 threadla
p provide ade qeok Cancurroney im the application
Coding fer use threada
Threads phould ure
amd tynchronjation, features J
or thie purpoee Fumehene 05 pubsoutines,
covrecinese f data sharing
postx theeads cam be Wed
of uge etatic or
giobal data 4 carry values across Aucceabive achydhliows
yay produce incorrect yaubla wWhun invoked concurrently
woithouk — amy mutual
thread von pafe.
trclusim, Such youline are known aoKemel-hev Thraely
Thie ie implemun kd Ly the kemel, hence creation, Haminodien
omd checking o theiy ptatup ip peformed through Aah cop.
Thread Gente! Bloke (re)
ia pg Pe Rei
_ Scheduler 7 L Seleckd Te8
WDhon a preceee rnakep & creat thread. Aygo call, the kernd
7 . Thread
Cries o Yaread , aveigre id wit and altecakn & Te
wt P th
Corto) Ble (tea). The 16 Contain & peine fe the PCB of ™°
prasent proceee ef the thread.
toh am ent Seuye, th
ite 16 Ape
te CPO etok the
eg ken, FONE
the pduduler
in krruphed thread in + enomt hamd ling
; hb one thread
of ob threads 5 Aiud
cq chek whetey
sont practee Hhom the
Ceongidire TEt
The diapardn
the peleeed thoead
inkesruphd thread Tf both thrada belong to different
then kernch = foe the Gonkat t interrupkd thriad's
vo ¢ adicka thread's proces
PCB points in ite
oclong h ite
usw the
proceeee
proceee amd — ‘bead mee Comte
precese context achong will be
Howeuer powing $ loading
paipped if beth threads hoclong te the dame procter.
Thip veducw puidching Overhe Suildring betwan kernd-leel
3a 3
Hhreads will be 10 me fork than pitching behocen proceepen.Advant Di (16
- mo” § Dicadvomtage yf Kernel lel thread Ls
Advan tag
x Kernd-lwel threads are like process cxcepe they hove
Emabls amon! Ff bted information thip it Umviniont fev
programmers?
provid poralliLiow
* Tn mulkprocesor paplana, kernal threads
x Tt : :
Tt provide betty cemputationas sped.up than uacr lwd threada
Disadvantage
we Ti inung overhead f ome hamdling ag pusitching Joeboun
denied © performed ken.
Uper bevel Threade
Uper (eel Hncods are implemented bya thread library,
thvrad
a code Of proeeee
without involving
linked
The li bsary ake up
Ane keen and itoelf inkerleawe,
immplernemtanien
opeahin 4 prveade Im
invokee dae libro fauncbion
funchon creotin TE {
the proceee
a new tare The library
amd prove coming, new thread f°! pcheduling
: km, th
wohon theead “yumning piak anvoks a library fone m, the
idur to amother
drudssling, amd pel
nad beliwes that the procter
wrong fret pogorre ¢
oceee- The kes
Tf the thread library camno!
an the preeeee iy make e * block me”
4 coll. The kernd blocky the precteethe thread library cod ipa part ¢ cach proceae nt
peaforme pchudling fo pelicl @ thread amd orgem a th
exeauton . THe 'e mopping f the 76 f rolackd thread
int PCB 4 He preceee
The thread library wow information in the TCBp te ducide
which thread should operas ak ame fime . To dispatch the
cov ptak ¢f the thread Ahould become cev ptade
thread , the
phowld point
4 the proceet amd the paeceee atack poiwky
do the thread e ptack. Since the thread librang ie a park
of preceee , cpu ip in the user mode. Hince a thread
Cannot be diypatdud before loading mes informakion inte the
paw. The thread library has 4 use the momprivileged tnatructio
fo dhamae ceantont of 7310. It load the addres “f the thread »
flack mato the prac addscap raiokr, It Uso tu PC ida 4
thread 'y CPU pla frm im itp TC Omd exeutl a bramch
imbuchon Fromme fes Conbol th duired inohudion.
>
Proveee tanks F ( SQ )
Trvvad HO
OOo
+f aa
VI
ee
Sdudulng fo ae
Uper ford thveode Sieur [>
—~eolechel PCB@
Advantage dis
ad
tdvamlage § divadvamtages f uger_lovel threads
Advantage
x Th o tds ‘
© thread gwitdhing overad will be pmaller Hnam vger
lw threade.
* Each proces Com ute Hu bet scheduling policy thak
Duib ite nalure
+ Suitable sdk duling puch ar prioviky"barch 07 Found vobin
ddhuduling methada Com be ablised hr yeal-Hme oy
smult thread — povey ap plicaiome :
Binodvent age
xe Kern dow not know
qf kernel it
duknckion behoen @ thread oma o
requird.olock a thread thon it ha» fo
proces’
att thread will be blocked
blodk ih parent Precon & Twee
undir thot prccee s
xe WIHhin procens ak moat ome Hhread Com be in oprvaliin.
comnot provide parabbliem .
Th Urey web Havcads
Hybrid Thread modele
uper- lod Hnveads amd — kernel-level Haveadte
Tt ho» beth
uper-lwd thread, with
amd @ memod = Oppociak my
kernel- level thread. ADiptront
luk threads provide different Combinakion
{ veeclad Freeads oma
methods of aspociakng,
uper amd kernel
of low pwitdhing overhead
the high comenrrimey paralleliam of Rkeenel-lwek
threada.The thyead library Creat
y ateg Uper-lwd threads
amd aprociaty o Thread Gmbol Block (TC6) with efit
eae ¥
wd thread. the Kernel Creatis kevmd lwel threads a
ima
proceay md appociates Kern toread Control black ( KTC8)
with each keene level thread
Apeociahen
Haybsid
Thread ry
ty xreee
Hom to Om
In mmy bh ™ i
4 € Oppociaton method , a pingle kerma lw thread
rp creak 13 preceee by the kernel oma al Uper level threads
Creakd in a proceed by the thread library ove amociabad
Hrread . User - lowe threads Com be
with this kane Loe
Couarrent withouk being parallel thread puitching inwre
teep overhead amd bloding of a uper-lvel thread leads by
blocking of ou threade.
Ln tme-to- ome method , each Uper lel trread ig pes mnamunt ly
“led thread. Threade com optrak. iv
into @ kernd
™ ped
parallel m differnt CeUp of & mnulliprocepnor Ayyptorn , howeury
euvitching bin thread ip performed at kernel level and
inoue high overhead . Blocking of a. per -lwel thread
dow not lock other oper level threadgar
lwd. thread
in mow immer aapcciation , a uyiy:
os 4if fot
ie mapped into different kerma lev threads
time. Tt provides parallaam amd low overhead 1 pcitbing
However ik needa Com plex irmplornual ation