0% found this document useful (0 votes)
10 views10 pages

Os Assignment 2

The document discusses deadlocks in computer systems, explaining their definition, causes, and the conditions necessary for their occurrence. It also covers algorithms for deadlock avoidance and various CPU scheduling techniques, including First-Come, First-Served and Round Robin. Additionally, it highlights the importance of process synchronization and the mechanisms used to prevent race conditions and ensure data consistency.
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)
10 views10 pages

Os Assignment 2

The document discusses deadlocks in computer systems, explaining their definition, causes, and the conditions necessary for their occurrence. It also covers algorithms for deadlock avoidance and various CPU scheduling techniques, including First-Come, First-Served and Round Robin. Additionally, it highlights the importance of process synchronization and the mechanisms used to prevent race conditions and ensure data consistency.
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/ 10

1-What u a doadloek and how can aect a

yalem?
Ars.Deadloek s a ituafen whu tuo Cn moAL
Proceses au rable to proced beeaue each i
waiting eor a neoee 'held bs anothwn.T can
halt stm opoaton as none 8, the prOCeSses
invokved can continuo.
Ractor detumine whthen a detectlon
2- What
lalgorith mut be ullized in a deadloek
avoid ane wystm !?
Ars. Factorts nelude the fuqueny
Jalloeafon ntqust,the 'uytems
lallocafion palivs,and ut ken tu polurttal fen
cincula wait xut. hu cost dh Aunnvg the
detection algnith mvesuu the cond a, apokt nlial
deadlock altb inlluuneea thu deiuion.
3.What e bemahoau 9 What opealíor can be
|pofermd en on a Semaçhonu ?
ArsiA amahcat in a aunchcnizalion tod wsd to
tonitol aceU to shand usouwee:luo cpenotion.
tan be perfomud.
|Decaes theamarhont valus andi it's lu than
|ZO10,4hu procen is blockd.
)netaae
iqnal():
thescnaphone valu and thunu ane
bocked pKoteses, on them
4.taplain Ahu coneepl 8, Proeu Ceondinalion ?
Ans.Proecu coordinalion enuUN hat mul tiple
prtoUMes can openate eoruely when aceuiing
ahad esowes or data- MeoRnimm liki
stmaphoeS and muteas au used to pruvent
issue lihe race cordltiona, enuinq Drdly
enerution:
s.5.Dilounttat bekuun Muku and Aamaçhoru ?
Anu.
Muta Sennaplsre
.Aceen Control: .Access Con'tol:
Aos onls one ptOCLs to Cun alomulle pKOCULU
aces a netoe at atme to acces a eowe'bad
|(binaay lockins muchanum) on itn sunt (can be
M. Ouoioukip: binay on evunting.
Can enly bi wnlocked by .emanhoru:
he pracsa Hhat loekad t Can be sinallad (ineum
ated) by any proes, ot
wotted (dioumuntad).
Leng msuw Jupe:
1.kot in hu puzpo CAU AekodulinA ?2Mention

Ana. Pun po 4, (PU Achid ufing :


erU sahhling a fundamanal (unclin o, the
openaling sytemthdt managr Kow prtou~e.
|ane assiqidto the CPU (or bxeeution. hinee
theu ale quunally mutiple process ALody
to be eeettod at bny inu, and enly oru (P
ehduling u nuca to
o proces them, ch
improve syste cney,ruspru imu, and(PU
puorpUse is to maimize
ulizatio and thnougheut whl vinimá~ng
|waiting timu, nespenu timu, and tunanound fned
beheddling Critela :
hhe eaituid und to evaluate acheduling alqurithrnd
nlude
. CPU Uizafion:
bay as posith
Measueshu numben , prtoeses eompkd pu
unit timu.
m. TunaDund time:
Time taken to neeuke a panteulas proess from
aival to tmpla ion
Iv. Wdatlina Time:
lolad tind apaocuss apondk weiting in thu
V. Ruspone Timu :
lime from xIquest aubisin unkil the fut
Ospote ës produd.
CPUbehaduling Algorithm:
Vanious coU
|1. Fust -Come , Fiut-hedved(FcES):
hu simplst sehedullng alqorithm whene prcoCUAes
lae Aenved in the odet Hey asve. Tt fain but
learn caue isuu iku the torvOr clet"ohu
|AAcrt jobs woit fore lorng fob to ctmete.
. Shortust Job Nzt sIN)er hontut Job Fiut
(STF):
Thes algorkthm aelett the proess with the
Am allest exeoution fime- jt duees avage
aitingSndtimueanbatleadaquie Knouwldge 6, fob
length ko skazvalton 8Long pikoesnes.
|iu. Round Robin (RR):
Each prOUS B givan apined lime ot, called a
louantum, ahd prbenes de soved in aeieulan aekunnod
lgueue " Aften a processs Lime epies, t es
to 4he end o, Whe queu nat finikud. The alqorithn
Rcemmonly wud ntine- shaing sykem.
v. Riordty ~ehuiulirg:
|lroses me qiven a priority,and the CPU i.
all oeatd to Hhe prtotese witth tho lighost prioitd
Lowu prinityproceuu may epeione slaivalion
nct nmanag propetywitt hibriqu. ik1 agag
|Proeesses au divided into
sysltm prtocesen, intuactive
puierity er type Ce-g-
proeese).tach queue tan have itu eun sehed uling
ladqoritkin. and prosner au gnaly not movd
bYwen queues
. Mullliv! Feadbark Quue Bhuduling:
This iu an (atnim o, multlevel queu sehedulirg,
chuu prO ees ean move butwun quuws bastd on
uhe

la it adjut priority bauad en the proesy'» behdviou


a. What au the rueeary condilonu to achiuve a
deadlock 9
Aru. To huve a deadlock ; fowr condiions (Coman'
condilions)mut hold imiltaruowdy. heu eondiftond
.Mutual Eaelusion:
AA Loast oru LeLOue must be held in a non -
ana ble rmude- That s ,enly enu proews ean us a
MUoWe at any given im!
t. Hold arnd ait :
AAprtoces holdirg at least one esOUe i wfng
to acquiu adtitioval ae:owws hold by cthen
Pro uses"
lin. Alo Prumgtion :
Re.oues eainnot be foxotbly takun fro a prtoey
holding thum. Resouacls au eleaed 'enly volintarly
by thu holding prtoees after it eomplku itn tauh
CBeulan Wat :
Aelond chan o proeusses exitb,wheu each thu
proeUs holds at lut one UsDUee naed by bu
Ineit prcOCeSs nthe chain.1kis fonmu a cueutan
lduperdency arnong procoses
B. Duenibe thhe prouss ached uling mecharim n Ox
Ary. The proes sehedulvg meckanim fn an
lepenating sytem (0) involved managg tthe
|poormanee and wia xpvúne·Proeu sthaduli
ecenayfon mu titaiking , uwke multla
pILO LMeS ale crU fume, allbwUg for concunent
exeeution.
Key Componunt 6h Procs schuduling Mechonim!
. Proes Atates:
Pceses kypeally traniton bctwen katu.: Meu,
|Reads, Euuig,kaiting lor Blocked), ard Teminatod
on ateling oa prCea fron
roeUu beheduding freuson0eulin. trom
u Ready queue por
. Sehedwvu:
+Long-tom Athedula (ob solhedule):
admitud to {e
Decides uhich procvues ae admitted {he
wul sytem
eution.1t contcols ete dogmuu 6, -
proqnamnivg by maintaivng aabalantodmia &,
ao bound and'cPu-beund proes.
10-
HAhort- teom deheduler lCPU Aeledule):
|Aeleebs a pross from the meady queua and
alloates CPU to t.hüs iu a eritiealomponent
aor quick deeiston -making rwig efieont CrJ
utiation:
Medum-tam Beheduler:
Teponary removes prtoceses from menoAy Li"e",
Awaps thu'eut) to inprcove th m
Proess.

to anothn ,it saves tte state o, Hhe cubvunt proces


and Load He
the atate 8,
ô the new prtocea Contat
ARt olhing allown lor mulktaking but ntroducu
loveahead.O
u. Despatelun:
hhe Dispatehun is neLponsiblu fex kandling the
ransilion bekwen proceses, ineluding eonkut
Atching, Aitoling to wr mode, nd jumpingk
he niah oaion he prOCeK toaUMe
0LeCulon.
|4.Elabaate on the diert ynohaonization
tehniquu wed in
Anu.Proeen kynekaonizaion i exucal to avoidmultipl
eonglicts and onsuoe data eonaistneswhen
proe aeesn ahaned neso es-DRoert
kynchonizaion tuchvdques au implnented to
toeoordinakd
lavoid iws like Kae eondions and
LYnt- prOQS eommuiea lion:
Kay Aqnaunizalion Tecktriauu :
.Locks(Mutei lock):
mutu a lock uud to prottet eritieal sections
IA shad
& eode, allowing oly one prOceM to aceu a
cwee at a fBu. tnty the proesn that loe k, a
esowe ean unlock it;tnsugQnclusive aceess.
l-Bemaçhote : that help
Aenaphcies aa nqnaliny mechani
manuje aecun to Atcd nouneus ky tome in tco
Aypus'
Binany Japkere :
cto as angk locka, aimlan to a rmutk. alleuing
tine.
only cne pitocis at
|Alows
+(ounling smaçherte :
mtlEiple proeLSAUs to aeces a nosoee up to
a apeeiiud tourt, waul when mudtple inukanee d
M1.Monitoru :
Moritors au high- level Ayneknenzalion eonstru
hat tombine daoed vtablon and prtoecdunes in
la way hat only one prtocess can ezcèute nidu tHhe
monitor at a liu MortorS manaae eoneuont
accs orte than low- Revol donatructs
Bmaghoruk
In mese
Pasing:
pasind, proesses eomnlunieate by
send'ng mlaqus tb caelh ethn hia tuehniqe
unohizes dtlions olthout shaing vavidblu,
poviding aafe condinatin and avdling
eonditions
anu kmgla loha that eovtonuouáy
nwoue becomu
ket o
eondiion in a loop until a
availa be. Thy au lightuweight but cawx buy
waiing , so Hy oe mallyuedtimet:in nullt-proouor
aystnt for vety shont sait
V. Baaish dynionization :
sd bhon acad prtoese
LLcuRon pint bolore
baovlen
tho
bochid nea haveproese al untl Iods
proceda
prtDUM no
that ensusUs continue
It Can

You might also like