1. The LRU page replacement algorithm replaces the least recently used page when a new page needs to be loaded into memory. It tracks page usage over time to select the page that was accessed furthest in the past.
2. In the example, a memory has 5 page slots and initially they are empty. Pages 0, 1, 2, and 3 are loaded in order with no page faults. When page 7 is loaded, page 0 is replaced as it was the least recently used. The total page faults is 6.
3. LRU aims to reduce page faults by assuming pages not used recently are less likely to be needed again soon. It replaces the page that was accessed longest ago based on
1. The LRU page replacement algorithm replaces the least recently used page when a new page needs to be loaded into memory. It tracks page usage over time to select the page that was accessed furthest in the past.
2. In the example, a memory has 5 page slots and initially they are empty. Pages 0, 1, 2, and 3 are loaded in order with no page faults. When page 7 is loaded, page 0 is replaced as it was the least recently used. The total page faults is 6.
3. LRU aims to reduce page faults by assuming pages not used recently are less likely to be needed again soon. It replaces the page that was accessed longest ago based on
1. The LRU page replacement algorithm replaces the least recently used page when a new page needs to be loaded into memory. It tracks page usage over time to select the page that was accessed furthest in the past.
2. In the example, a memory has 5 page slots and initially they are empty. Pages 0, 1, 2, and 3 are loaded in order with no page faults. When page 7 is loaded, page 0 is replaced as it was the least recently used. The total page faults is 6.
3. LRU aims to reduce page faults by assuming pages not used recently are less likely to be needed again soon. It replaces the page that was accessed longest ago based on
| s eaJloCk is a Situaaion wheve tbwo 03 Moze Ppotesses us aye Wuting for each 0the0. Foy example. let assume, we have tw0 proctses P1 and P2. NOW, P%0(es5 Pi is hoting the vejouce Ri and wUma or the yesouace R2. A the same fime. the Pyocesy P2 is havin1 the esoUntt R2 ard is wating 0 the vesource A1. |S0, the Pao(e55 Piiswautn fo P7OCeSS P2 to eJease ISeSouyCe and at the same Yme, the PTOLes Pz is WaUting to Po0esS PI to velease ts Ye$ousce fnd ho one is eleasing Qmy VSoux(e, So, both dye waiting for edch Othe t0 xelease the yeSourte, This 1eads jo ininite waitint Qnd ho tw0k js dône here. Thisis ealled Aad0ck
u DATE
PAGE
Nere ssany Cohditons o JeadlocK
There There {oux deveht (ond ons that esuLF dze in Deadlock, These foux Conditions de also knoun a COtman (gndY+{ons gnd these Consitions hot ave muBu4ily ont ve.Let's Jo0k atthem one by xelustVR.
1 Mutu Exlusioh: A Yes0urce Can be held by Oh ly one
Process dt a time. In Othey wOids. if a Pyotts Pi1 is usimg Some vesS0urce R at a pavtYculas in$ tant 0t time, then somt Oth potes P2 Can't hold OY ue the the same eGOURE R at that paxtitulay instant of Yme The Protty P2 Can make a equ 0r that esOuUrte A bur it Can't use thot 7e1ource simul tane ously with PYOLtS Pi1 DATE PAGE
2Hold an Walt:A P2oteh Can hold a numbeY 0
esorce a d Fime and a the Same ime, Can eques 0Y other resouxCay Phat are bint held by SOme Other pxo(e, for exaMple, a Pxo(e Cgn hold tuw0 yLgoUty A1 gnd R2 dhd a he Same pome,ft edn vequef some tsouste A3 haf s cuvsenHy huld by P10Ley P2.
3 NO P7etmption: 4 Tt10UTCe Can't be prtempted aom tha
p7otey by enother p30CEM, }brceuly,For example, t a prorey pi is usin jome Tejou(e 8, 4hen Some Otke PO ey P2 tant {0efuly take hat tsaure,.l{ St is so, then what' fhe netd or vavfouy StheduJng algosithm The Pro(ey P2 Can veqa ext OY Hhe Teioute R and Cqn Wut ov fhat vtiquhee fo be ted by h por Pi DATE
PAGE
9. Culdy wair, Circular ww 13 4 Cont1on when he irs+
PYOeyis waiting0 the yesoute held bY he secaned proLey, Ahe setoned PTOCe fs ai ting fo 7he he yesouce held by he hiid Pyels, and So on. A Jat, the Jat PTocey is waltîng tor he ye$ouT(e he by he first ProCey. S0, everyY PYoCe is wwtmg tor each 0ther t0eJease he TesoUrce ng ho one is veleaîng heir 0wh resourte. Ev{Yyone ís waUing her For 94int Fhe res ouxte. This 8 Caled a CiyCular w t DATE PAGE
Explajn LRU Page replate algogithm wih an exanple.
0r memory I h 0Praling 3y5.Pems hat use pPaging managemehE, page_1eplatement algositbm dr which' Pafe neecded do be. Teplactd needed o decide d hew pa WkoM hew Pasa COMe in wheneveY not presh in mern0xy. Page aut s reter"and 7eplacej one o he 0CCur nd ORIYOFTng system needapaa. xiSn Pages with newly Teplacemen algorithms Dittevtnd pasi to t0 decide which pag£ Suge difvent ways is to vedute or aM algorithms Teplace. The Jayge numbey of pagedu3
(LRU) d gasirhm is a Greesly algothr
h Leas Rcently used leas ecendly use4 Teplaceis where Au Pafe to b Jotality of feehte, fhe Theded is based on reLendly ustd pa is hot ikely Deas 30u23032 deferente 94sing 70120 1e say the pagt have pase Slots empty. IhitJally au 310+S nitjdl we ailbtased to he empty when 7012 are tpy,So is alyeday Gheiy so-> 0 page fault SI015- y_page a s because when 3 Came it will Jaxe_he PJate of7 Jeayt Teçently us > 1 paze fau 's th meMOYY S0->0pae fault already 0 is of i 11Pageaul will Jaru place DATE
PAGE
erence St7ng-s0page fau
NoW 0 Ghe Uther page mem ory. dve alTeddy dvajjabla in FhL bltaose fhey