You are on page 1of 12
‘ste UNIT IIL 3 | Distributed Mutex and Deadlock ‘Spitabus Dern hl acon Apath: tin Priori Lang ies ‘Rebaspem's Arta oe r-Sea ac Braa pr ‘Dead Ben ined Sposa Md: Pra Nas (Snatch ar a ip he AND mod on Oh Tonics 31 rt tn ct te raion ~ 59 tomer aeion 24 nectar san dy 2 ma 18 once Spe ten ste = 37 Sammon 21 Porn ed an Sag - 30 taut et st 19 = 5:10 coy eas Ain re AD oa ei 411 Chany Anas Aone OF Mo EE pistibutes mutual Exclusion Algorithms : Introduction + tl eschon est tat concent process make a fran! acs 10 hare rsurcs oda I euist the acne permed by 0 wr on 4+ Ina debt sytem ier sed vale nor 2a eel an be ud a rer imploeat mia ehoen. Thay salen hs 4 te bo ‘ete om mage png an cont of impeicle menage ys (Sa wo comple howd ofthe te fhe ye + Matual exlson: Makes sue tht concur! pos acs shred ures {Siu nw sed way. pes sy Py eating Heel secon, then ahr proces fan Be cain hel sets «+ Beampe + Upting 2 DB or ecg on sigs oa 1/0 ce 1 alem of mul ecison fequndiy aca in dite aan whew Concent ar ose ese beers vole + Motul econ he fanart i nthe dig fda jst. 1 tyson: Te code ted preparation for ent exe scion {Cite sein The code be proce rom onan execu 1+ Exit scion The cde eats por ving tei ction 1 mamalnder secon: The et ce EI system Mode! 1+ Ds matul ean agit st desl with unprdkble mssge lee ad incrpte owl of syste te Syste de The ye cons of N aes, S53, Sy- We astme aang proces ingen ch ite, The procs sie 5, dred by pi 4+ Atay natn ey have seve routs ar eal secon. gues ep thse rons and eres em one a 1 Regering cS 2 Beating CS A Netber gusting nr cating rues or CS EBA RALCATOND oie ae cons as ‘itaeton of Mul Excision Dire yp of art are asdf sve prble of mutual exon In trad se. Bu se lg ler tir coca gy opeingy may be sng boy ser ees Ty alo mani dllrent oe of +The gis a int cae 1 Nomfoln bad + Requte cule romde of menage exchanges fr heal sist bie 2 Token based = Peminion pies tourd from one site 1 another Se Is ‘ewe a et is alton poses he ohn ad cots 0 Tele ohn st the nection of he al etn oer EBB rocuiroment of mut! Exclusion 1. Fredom fiom deedlacks : Two or mo st shld nat ene wat fr 2. Fredom from starvation: Aa ahold not wal idefitely we ote sie petty aco the CS 3 Sc fame: Ruts a served in he Dal deri wich hey anv, | Fat nlerance A lpi shoul be le detect aleve fo ae EEE Pertormance Metrics 1 Mage amply he it of mts gi eS tn 2 Syncrmiain delay «After «te ees te 5, i th ne eid bre ‘hens tees he CS. 1 Response ine The tine ners rues wi fori CS ean fo te over fers equ meses ae ben sett 4 Sylen throughpa The ata which he tm eas egies for he CS. System drought = (SDE) where SD i the sydvoiatin delay and E le he average crit secon, Fig 224 showetheeypcveketion dey “ Sychoiion delay (): A Teves > Bese apone e A rau > A aes + Terhat | Srt al er e a = 11D + wh TEBMEAL MaRATON wp nn ey oe arma Commer as i ten dst Aten eae oqunstng the el ston Ser REQUEST.) 0 each ter ste, and place in he eat qe + We res the REQUESTIC tetas a tinted REPLY 4 land Pls the REQUEST in he epat que Synnctny id Condons fr entaing 8 Fa, 224 Syevanioton det + Pefomanc fatal econ gen depends upn the ning cnn of the sem + redommnce may depend on wth loi ow. of gh Bet, wont cae, fd erage a al et. the ln hgh he thre aba pening rapes form econ ig 322 shows the espns tie, EEL Lanpor's Algorithm 1 ach proce ely and uly compte he mgs vo te dh sane ess ean an edb axl canter y dtu aera amin a al ree 1 sample of sontcon toed algetims are = Lamport, Riart Agarwal, aco Carvao Le Be te que et of eS he st of les fom which St nes ermison when mans oer CS. «Each arp ares gre of que erred by lope inet LL: Sas eve megs wih times Inger han sie +12: ago eat theo af te gust gue etasing ho 8. 1+ Boman (C9 rm he request ge, and send» RELEASE ll se the eg set 9 fom aoe ‘+ When sce RELEAS. Mt eos th gest op ergs que + Asse to poss, 2 CS stay [1,2 ld in bh proces fet have rtd ages th lage esanps fom ll hes ei fegue are a the top of a ge 1 Wi0G, seme SU gut ser So SS rages SP gna, bat SZ ie leat he op fe quae comron Optnizston 1 Tn Lampoets lor, REPLY msg cn be oid in cetin tons. + or engl te § nies REQUEST mesege om te Safer thas Sent ‘sown REQUEST rnsnge wih mstany gle ante st fe S's rat he eS edn end a REPLY mesg 1 eS 1 Thee tea he sc le ron Fam ie han iby en cna tat ie dn ot hoe any alr Hema egos heh il pening, + Wid Bis epinizatin, Lampor’s agit res etwon 30N = 3) an 2aN ~1) mses pr CS extn. ig. 31 shows the optinzatn of Lamp agin ap 1 Sie St a ae akg fr xe sen “oe RRLEATN mp TEL RUA oe eae Fg 33) stp 2: Se ta anton, Beek BA ‘sx. a 334 0) in Cony ae itd ter aden “© One ad ise probit fare deter or procs ms out kf pres fan coe scion 20300) mesg per Senco. 1 Sy delay erage menage ey BI RicartAgravata's Algorttm am 1 cu Agovas grin an pint on Lamp spi 1 eareAgawal alg see nly to types of esse = REQUEST ed REY. + ame a al cs np ga cei apd ac Te algorthen roqie 2 ol cdeing of requis Request re ode Creordig tothe ght og sang Aste ae ei! pros (eer ae compare to er hrs 4+ The pes a rues ty 9 3 CS malic he eet mesg al er proccss compen forte tae rescue Proee alowed ener the CS ‘Thon a proneens ae ei H.sp The equ mcs coats of Theregeting mcs tum pal coc) ani ete + Bch pos ape te with pct the CS sergio held ‘est equating the erica section: Tr Ragu hen Si want en the al scr brow timetmped REQUEST menage 9 al se 2 te «procs rcv REQUEST mess, maybe oe of hee tes (cose 1; The svi ot nerd he ial ecto, send ely OK) 9 send ‘Gave 2: The rive sn the Bsc: do at ply and ald erik 8 fe gun of ‘cave 3: The rv als wants oe the ical etna ha cr gust In fhe he ens compurs th inesamp in he eed message wi he ea Ibu at out The erie ime wine te recor He et, Wve 3 ey (0) 0 cer Ihe rae ae the eae esa the is he ine ad does Srey tad dae he gue ogo” 1 Whe site Sere ita ion aftr ae rcv REPLY nes om all ewe ro eerie preeernersseareeceenat Retain hectic! ston 1 When he es th CS, de RELEASE) megs al its ins requ 5. Whe 4st 6 cies he RELEASES) mesg rm i cde 2 RELYG) remap to the pet le waling inte ae an dees ht erty fom the Swe the gure ep, then he it pe tte elect tha he is sent ut any REPLY mage Ontimston + Once sie Shas toch « REPLY mesage fom 2 ae We authrzaon mpi nhs menage era ae al sre» REDLY meget ig 84 sows etn of Rit Aga get, mp —o A i a stot ci me Fe 341) Soe aaa Dott Cnng 20 uate ir an ct Step 3: Ste Stee the CS and ends 2 REPLY weg St. F344) | Sew tee rm ait ho ct al ig nd Finca, oan 2 Erlinda Ate ho TT EB Token-Besea Algorithms = + tn the Toes sin, wig foley rl aman al he ste tcnted computing sees In nonnten Kee agit, Hee sno len ren ot my cone of tsk fr aes a coms at itt rant + Token bas algeths te SueuiKasamd algottn and Reymonds te leit 1 ste ca acs the Jock (sete) HF hae token Brey proce is «gene mt: feat, IEEE curuisKasom'e Broadcast Algorithm + Lagi olan pacing he mma sight fo hese eo in jk in 8 replied faion wnong tv proces whoeer hols the taken i allowed Yo 1+ Aig tla shared anang lates Tis means Soe mamer ad + Stes nement it sequence sanber every tine uth faken. Tis mea, ‘sca of tenes (ea feedon,staraton)ae me eres, ‘To eer CS a ste rade te REQUEST message oa ter ies Upn rein « REQUEST mange,» ite tht has the ten send he ako (be rocsing ate oly ae esti CS I CS, rte then, iy ale has exe he CS. [A ate can reply ete CS a lag a hls the fhen and tee ate m0 ning eg om her jor Deg esos 1 No RELEASE/REPLY meas arto bal pts + ac sie mind 1 be able diingush ntdtad REQUEST espe fom ‘urent REQUEST mesags pasting sue) + These wih he oer edo ow which le os the tke en Import Dts Stace 4 The on cobs of Qa gure of rung ls, Ay of neg, ALND nee UM] the segue umber of the guest tat ste 5 eam ost ‘cl and Nh number tesa LN op ak he at est at ‘woh ba end ‘+ Aste Shops a aay of neers RNIN] whe ROG i te lrg xgunce ‘uber reed of from 5A REQUEST) inten te § gusting ‘ee CS wit a te squence mbet TEGHGAL PURUCATIONG? on wp | EMAL ALERT? owt ane panes vn taster ona aamad company 29 itd ran Dd ‘eos he dea mur i 4 ee, he proces ec» megs Afr 2 Requesting CS: te icements it que mtbr, RNa ends 2 REQUEST, 6 all (Sher io wth sue number 2. When st cies hs menage sls mane) aan sl tok i send he olan 5 RAEN Executing 5 1 Ste en CS whan ta sie he taken 4 UNI Rabi 5. French ot nthe oan gue, pend 1D 0 queue RNIN (token quee i nonempty fer upd, dete top TD an nt te india yD “There: Aroqustig #80 enters 5 fie ne rou Tolan rues he te sites in Oe tine and i east wl be plod inthe en une i Sie Since ere ean beat met 1 ques in ft of is est he egesing te can Ben Si te te Pdormance 1. The alge i spl and fin. rages 0 ae N' mesagss per CS 2. Sycicnzation dey DoT. No menage ded a stniation dey ‘amo i eld he hen th tine ot eet | Ae a au kat ti or ml cn tl eT EBB deaciook Detection in Distributed Systems: troduction +A dotted ese cons of abe of ss contd by a netwe xh ‘Se maine sme of Be races the spe. + Pes with » gba unique oir ino he dsb stem. Ty ke source ees 2 cont, Tae ee cone per st. Arse he prc makes a oun of he cota, TEDL IRA DEo emnrece rcs mals 2 rect ta Before gale, Diced and sid fhe een one pos at hole deed recur 1 The cn tech ste cul mina WIG on th process guns at ‘howe about Ths the al WR + Her eh tH nl dt et tn «Tom ea ase p uaprcir-snal eum 4 ti mul ting re + ton penny tse es i a + However, he ded wl nt be corr teers ls hy extange fereuten i tome den ee, IEEE Nocossary Conston 1A roar can Be ino tte: Reming or blcked ta the ring tate (bo cl he ative a), procs as al hd ours al eter xg oF nay frauen ne Mock ite, procs 6 wag oa Some res. + Daaick ntaton i whi 2 at of romine Bcked wating fo oer Following conditions shoud ld sale for ead os 1 tel exon 2 No preemption 2. Hol and et 4 Cesar wai 1. aa ecanon One pres my is # rr a ane. One pee th bon alia» prt rou has eacsve we of th este, NO cher pros an se 8 roe Whe alloted fo a proses. 2. Hold and wait A proces may hold rescue atthe sane time it gusts ie aces GO) a D> Jat one rescue ended by Be nett 1 proces in the ln. There may be mae m) EJ than two proces Havel 8 CESS ra 54 tye ee wat eg Pe 36) ‘poses 4A.Ne preemption + No_remuce can be {orl removed fom » proces ting Raut cin be ae ely By the ‘Splat fh prota tr hn the sein of an enteral aay 2 dec epson orf he ons natant in he coomanty of poses These ces ae teeny fr 4 dvd ex. | er wih ile «dike any fe or | err Pre EEE systom modet 1 Resource type 2. im ous CPU ey meniy a 0 ios + Back source ype hs WY staes + ch proc iae 2 rou allows 1 Ragust’ 2 Use 3 Beha EEE wait for craph + Teste of proce sure ntraton i dc systems can be med by 12 pers daeed gap cl + rs alan graph. The oles of he ‘paph are pocaes and recurs 3st, andthe edges of he gph depict ‘gnmentsopening eg 1A pening eg repro by a et edge deed fom the nade of 2 _msing prose 10 then he od rear A esc gene epee by a agent edge de rm he ao oh ge a tee te he mgd cee + Aspe eden ft sure aoa graph cts 2 ac yl oe {inc Be, 371) shows roca etn ph RDA PLATO pr ae ied Det Dee ee ie 374) Rese alocton ach + nde soe, he tc be mld repent bya diced graph ned» WaitFor Graph (WG) 0 WEG, nodes ate prowsas and thee rece ee fom ne Pt noe P24 PL ose td wating or 2 lene we A yom ded and ei thee ic “jor ot depenting upon he undying mee inthe Fl 327.4) War WIG. Relig wat fo raphe ecu atin graph lestown ia Fg 371 0) EB] Protiminaries : Deadlock Handling Strategies 1+ Tore ae oe ste for handing eck 1. Deadlock prevention 2. Daa avscnee 3 Deadlock dtacton EEE beactoes Prevention Frat td + Prevent th ceva conn be ding » a ondering of reso (8 ‘A proces can be gal soe nly acorn fo he ea nen + Disadvantage + Routes canot Be rest a he ore al ne eed Resources wl be loge th ey ‘Second mato {+ Bevan fe holdandwal conden by egg he proc. acpi all eid sours ble tring exon. + Diadrnige 1. rf of mene 2. Rese cnc, 5 Pes cn cae dada dating nil roc eqn, 44 Faure neds proces cannot ana pdt TOO ALENT wpa ete og a it ean etd eta Crt a ania ann Det or of tinestamps 1 tample + Use tnesampe for tacts t 2 daa - Each anacton has ¢ ‘he instar of ston 4 4 The ilar wai contin id hy comping ietamps St ning 2 temas ned he marscton wth an eae estanp aways |. Waine” method: A onprempive aproch I a Younger Poot ng {he rooute thn he er pean (hat want he rowure) ws fan elder roves ing thes, he younger prs hat wa he eu) il ‘Ths fcr the tomecewaaon graph fo be rected rom der 1 Joong prssses suling cyte impel Ts algo i Kao a the trite slo, Fl SBI shows wale meth o-8 Wau? atid A poentne ach, An aes! by SAREE Seto ye wal ew he nl pst pe Sarge pencs rhe soe te yong ee ra # ec rl oe ng ts ts tl el pe SOT Fuki yt oll cen a ees Te SSC ERIE ates spss hy 39 how ed et TERA PORTE re 342 Wound wat nated EEE be Avotance + Dele made amily, tf lag 2 ecune the ra ‘em te hal tne now aan + nee of flowing dvi, dk diner cn be inpral ‘Scot yen 1 hg mn pl st te ee ene 2, Dnt ses may dtc (een that ae sae bat lob ae sey be uno = Veriton forse ltl sate by drt ss nt be rutalyehae Lange onset t cack for every alc (tite astm may have lng munbe of pss a sere) EY vslock deteton EET Modois of Deadiocks: Pou os] 1+ Mosel of deat dtd ps allows dient Kd of resource request fr tht mei, ya presents Wy ellen adel res ight ese & ‘Syl our os combiaton of restr for i ect [EERE The singe Resource Mode! ne single soc model «pin in have a mest oe unig eg fern one ui of ure + So he mama utero aes WRG fr te sgl mur made fav te tthe prewnce of syle inthe WAG. sa dee Bat ace a ‘odo EEL the Ano bose! Seto deadlocked promny where ech poe was for + ou Meld by thot proses og nel n= dab, 1/0 rome on sre) AND conden | A prose that gins muse fr etm: an proce ‘rhe he ange all te sous 1+ The cot for dealok in 2 yo ing te AND canton the exisence ofagde Sic in the syle tide & pts can have a mest ene outstanding ‘ut the AND model mae pen an he seperti! + Set of dentin’ proce, where ich froin walt to seve menage (commen) en thr penn + Uae OR condition 1+ OR condition : A procs at estes ras fr extn ean priced when {thas aed easton of ose soe +The canon fr deck in psn sing the OR cio he even of {int A hot 0) condo «st fst sch tat or every nae a Kall ‘nde Kandel ens Kate ee nse 1h te OR model he pence of at indies adel [EET The AN0-OF Mode! y +A graintinofhepresou Wo mode (OR model and AND md i the TERA PORCH pt te td om 2 itt es atnaich Jn he ANDO model» gua may spe any combination of and an or fe ene rae Fr cep, in tbe ANDOR ede net for maple our can bo te fn xd 2), Ta dc hp of dads in sich med the no faint of graph trying WF, Since »dendlck i ble pope, dadack in he ANDOR model can be deed by rp appston oF thet for OR! dedock. EMD Chandy-Misra-Haas Algorithm for the AND Mode! 3 Name on ala een prof tk mar etl apie me ony sg nd dacs ih nat ra, ‘This & cari an egechasing probed algo. ale conrad re ofthe bt denice desc igen db ote proces males «requt for # resource wich fal rte ou the proces ‘nats a probe mesage and wns fo ea af the Poss Pol one ot Fach probe mage cons the flowing frmaton 1. The ido the proce tat lech hot nas he poe mews 2 The i ofthe prc ming th paar vr of the poke seme = {Theo the procs tha shuld env tbe mage When a pros risa prabe menage, # ccs 6 it ko wating or recor Ira fe comony wing be teed seman nd wil veal fh ad te here 1a is watng for rsa, # pues on te probe mesage oll pie ows tobe lg fecut i fel p “he proce ft madi the pre mess charging the sender and weet 1s proces ees 2 pre meget tpn ang ows thre sa cye hese and th, dado Fig. 30 shows dedi example. 1m hs case F tthe probe meg, fatal he meses shown have F, ‘the inti When th probe menage eid by pres Py it mois ‘ec sens tf two mare prow. Brenly, the probe mestge ee to rows Dealt : TEGAN ARLCATONE® pe ae ie. M04 Deateck sample + Adrntges 2) Wen 0 implement. 1) Bac probe menage fd gt 6) Thre very Be competion 6) There very Ee ov 1) There sro ned to cnerct a raph, nr to pss raph loro oor Ths lot dors ot ot (pata) denock 1) There so ed or pcs ta sacs IEREE Chandy. isra-Haae Agorit for the OR Model + Chandy Mirra dtu deck decton algotin for OR mode i ‘bond on the apposh of nircompuaion A Nad prom determi if (ti dendoced by ining dion cmpataion To tye of sige awed in fin compton: que 1) a Teruo tty Dolng 1 2 finon comput ite by 2 [poco and ae bing oto nes Fo POS [A Bcd poo tes dnd itn by sending ery mene ll ‘pects init dependent st Fan active pres rcies 2 gary © ely sewage cal + When Bockd proces mses «qr 8) meme itis the fling, I) Wis the fit query mesg red By Fi for th dec dection nian by fy (tod ie engaging i hn prpagaes he gry wo al fie proces ini Gap te ad mets oa vale ik 0 the amber of uy meget Devos conse aa ac a sas 2) iso nt hecengging guy, en Pret 4 ey mage 1 it ‘mame provid! , as ten crn Wick se Heed the copending egg Qy herve, td the Gu. + roms Py malas a boclen va ak ) tat ents te at atthe ‘wen cntiaoaly Beck ne Hct the lt engin ey fr pre When « Hckad pros eves py 8) ap decent in ety aC 1 A procs sends reply astge spots 1 HEN HT Oy ir ae reed reply lo every Gry mesa Ht hd me et gaa ‘gy. Ths intl proces dts each when rvs my meg he query messages it ad ete ERED Two Marks questions with Answers (01 Eephin he ee msl shan, = ‘ow: Asati poring pois opprnis fr «progam te cninae ‘wing ole ee whe mag fos gringo cee 2 vat nck? — fos ae pin mapa sr, adh ind ‘the panes Bing cn vet of proms tut eeher compat hr osm | 23am th te eso nesepe une in Rego seth ‘ow + Two pe of meses wed by Bat Apevale se REQUEST nd REPLY and ‘omnicton aoe at assmed Wo flow FEO ore. See sed « REQUEST Inept oa tern ge tpn nrc atonal end 4 | a oe atta 3) | ae watt occa? | | | ‘ow: Mut exited tem tks at only ane pres allowed text the cits (CS) ot ay given tne, Ln a tuted system shed ‘es or al heel oot be wed nent mal ncn Sp apg ST aa ST] 1. Token bed apron 2. Nowolan bse apc 5. Quran bs approx | ar wists te rq of mt erie iting? ‘as Regent fl econ goth ar | 1 ream fom devdacs bdo rm sation Skt anes (au tree 28 Vat ae petomane mere of ut enon aot 7 ‘ow Pevorancs mec ae mesigecnglety, yubeltion, Sey, opens ‘ad ten cut ‘Aa The ine eer» eet wi fr i CS acon oe neater gue (210 Wich ae te era or erating perenne of arts or mul as. Cis or ern psomans of agit er mt econ 1 Bandi consume which prop 10 the manber of menage st ‘ah ny and ext epertn. Ce dy nce by a procs a each ety and et pean Trout fe te, {231 vats be arantage our sever ie procesng uss tad ed of 2 Sal roses? ‘ha: porta prope fa a ty cn vie coven mas ‘lowing Bock sam cle wither! icing the ee rm mB tae had” ruin Th property ake eae portly acts te Sn ‘Seed reat mal Itch ee oper omen te frm ‘matanieg mule pa coin 3 sae te (G32 vat i. param deck? ‘Aw: A deadlock ht tc! Eat ot ly eck 6 ld » past (G32 ate wat aap 7 a | so ttc peste intent i tel soe oe mode | ‘y= Mt dct gph led» ome allen gph The fre | [esate we proemecs and oun of «wn ‘rama poning es A peg rp ped ty nt Ser ol med nqeg pa ot nr be tps ore ou ea mina tn: Armprepae pc gece ig uy, en |S pce ttn pe ye tee Be ne pe | it ira tom te ne wep dnd | fore om mn ue pei Te pee inom ew Some | eis tn as san tt | Am: Te ts tee hig et ek pon | caste a re ot | | tea yo met t wet | tm: Dt ae dno nil neat ste og tm | ne pn nubs Sr preg | ‘Sime w mt aay mac te cate west ne Wm spe ‘Son ture nim ee man ar ot | ‘Sou mp nn os | 7 vn nds sin tied | soe: Dk dt cai nition of procera neon fre | rene feel walt oo0 Tei ARLCATION on per r m ‘een, PURLCATENG® on wt way

You might also like