0% found this document useful (0 votes)
20 views

Adobe Scan May 16, 2023

Uploaded by

naveenk733922
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)
20 views

Adobe Scan May 16, 2023

Uploaded by

naveenk733922
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/ 24

' ..

I
l I n tr o d u c ti o n

l\7 !'~ ; ;h, m R.., f,~rit 'n 1t> \ \rr ttp mt•r \
\~~ft•m t ' • u11pot1£"nl.i1 Mo
,\ ! ,'13:.~ t~ J'lc t.,;;,,;;1 ~
,\ \ ~tt<'-»M ,x\ rsNS ll\l ot lon - Re /a lio n to pa
sh 11 rrd ra / if;tl sys tem., _
~, --.'"tt1'1:"';~ i ,'u tr, vi ,\'\ 'nd mtJ mO tJ sy.ftom.t
•""el.
1
ih m,)HJ , .._,1·.~u .t <1,~y ncl,r0 Pr im iti ve s for dis tri bu
11ow , exec 11tl mu De slR ted
'lf .li.$,triJn,te>J t"r>-,,y>1m,rirttt,.~ n l.,s uc s an d challenges.
A
~..,.\ iY id s <f iYt•.,.rmmrirotiott : A dis tdb u tt:d pr og ra m
rw t\i't)r•k.~ - Glt1bul .t trJ" A m od el of dis tri bu ted ex
ec utions
-.,\1.,n-ls \~f r,1\)<'f;'...\'S t\)fflJmmi<" ! - Cu ts - Pm t an
d fu ture co nes of an eve nt
-1licms. L<>Rknl 11mt
~ ~".t1.'tT :im.· - J'(t' t.) r tint~· : A fra m ew or k fn r a sy ste
• l'/ t,wic-al do rk sy 11d 1ro m of log ica l clo ck s
n i2o
tio 11: NT P.
C oa ten ts
r. f Definition of Di str ibu te d Sy ste m
, .2 Re lst ion to Co m pu te r Sy
stem Components
1.v~ Mo
· tfv 8t ion
.· . . . .. .. . . ·. .. . . . .. . De
c.-18, · · · · · · · · · · · · ·
1. .f Re lation to Pa ra lle l Sy · · Ma rks 8
ste ms
;_5 M es sage -P as sin g Sy
ste ms ve rs us Shared Me mo ry
Systems
1. 0-Pr im itiv es fo r Di str ibu te
d Co mm un ica tio n
1.1 Sy nc hr on ou s ve rs us
As yn ch ro no us Execution
s
1.8 De sign iss ue s an
d Ch all en ge s
1.9 A Model of Di str ibu
te d Co mp ut at ion s : A Di
stributed Program
1. 1o A M od el of Di str
ibu te d Executio_ns
1. 11 Models of Co m m un
ica tio n Ne tw or ks
1. 12 Gtob al St at e
1.13 Pa st an d Fu tu re
Co ne s of an Ev en t
1_1 4 M od 6/s of Pr oc es s Co mm un ica tio
ns
1. 15 ClocJc Ev en ts an d Pr
oc es s State
1.16 Logical Ti m e
1. 17 Ph ys ica l Cl oc k Sy Ma -1 5 · · · · · · · · · . . . . . . ua rk s 8
nc hr on iza tio n : NT P . .
..... Y , 'VI
Two M ar ks Que-stions wi
th An sw er s l
(1 - 1)
,,,, ..,.,
,,

"f
'. i
,
hn ll\linframet• Low price /performance rAtio i1 the
meu, computtng power,
l08t
'
t ..._.. 1 A collection of mim>pl'O('•NOl'I ofter " hettr.r prtc,1/pnt,irn
effc, 11 .,,1, i l,~.
w,y
~

\ lpNd I A dlatrtbuttd ,yattm may havt mort1 total computinK power lliar,
llllllmllne. f

l Diatnbulld ayattma bt oxttnded through the addition of r.ompn,,t'n~


CII\
\Nnby providing bttter ecalabllity compartd to centrahzrd Aystt•ma. '
4. ...... dlltdbatlon I Some application, are lnhertntly distributed e
81
9'lpllffilrat chain.
S. W.bUlty I II ont machlnt cruhle, tht l)'lttm u a whole can 1ilill li11rvivP, 11
fV11 higher availability and Improved reliability.
I. ~ powth I Computifta powtr can bt added in small incrcmcntR.

- ...... of Dlltrlbuted lyattm


• IHhlD lhlrlnc ii main motivation ol the diatrtbuted 1y1ttm. The term ''rc11oum'
ta i l'llh1r lbatnct OM, but It belt charlCtldul tht range of things that can
1111fdy N lhutd II\ I Mtworktd computer l)'ltlm,

• • 11'1 be tM eoftwut l'IIOUIClt or hardwue ruourcn. Printers, disb,


~~ and data IN lht example of IOftwart and hardware l'flOurces. Sharing of
• • • . . . . from Nrdwart compon,nta 1uch u diw and printers to
• • • ~ d6ild .tnlltltl ll&Ch u ftltt, databaNa and data objectl of all kinds.
..... 1M 111111n of vidto frllNI 11\d audio connection that a mobile
----o1.,....typt..,.-111
Ill• A NIOUl'et mlNpl' II a IOftware module that manages a

■~
1111•11i1 u followt:
a COlllllllrlq o1np1tcatect data
.._.-, 5. Concurrent transactions
1• 5 Introduction

'-'ghtpmenta
... ,... are shared to redu.cc cost. I) atn 8h:m:d .m dntabasc or web p·igcs are
ru •Q:'.Ve1 re"ources which arc, more signlf1cant
. to users without regard ' for the
tefYer or servers that provido tlw.sc.
, Types of resources :
.
1. Hardware n·~ourcl' •· 1fa• tll lti s,.. . , prmte,, i:-;uncrn, sc:ann,.r
1 Data : File, d:\t,lbns~, weh pngl'.
3. Service : Search l'ngin-.?
• Patterns of rcsourrc sh,mng vary widely in their scope and in how closely users
work together :
1. Search Engine : Users 1\t'l'd no contact betwc~n users.
2. Computer Supported Co-operative Working (CSCW) : Users cooperate directly
share resources. Mechanisms to coordinate user's action are determined by the
pattern of sharing and the geographic distribution.
• For effective sharing, each resource must be managed by a program that offers a
communication interface enabling the resource to be accessed and updated reliably
and consistently.
• Service : Manages a collection of related resources and presents their functionalities
to users and applications.
• Seffer is basically storage of resources and it provides services to the
authenticated clients. It is running program on a networked computer. Server
accepts requests from client and performs a service and responds to request.
Example is Apache server and IIS server.
• 'The complete interaction between server machine and client machine, from the
point when the client sends its request to when it receives the server's response is
caUei a remote invocation.
• Reeources may be encapsulated as objects and accessed by client objects. In this
caee a client object invokes a method upon a server object.

• ~ of hardware resources that can be usefully be shored and "ample, of


IIMd.-e and softWlre resource sharing

tieirtharing.
....... MOUrcet:
t. CPU: tes processor-int£'n.c;ive applications for clients.
.. Computing Server : It execu
l,. lemote object server : It executes methods on behalf of clients.
cPV capacity of desktop machine with the local
Worm prograll\ : 1t shares

J
TECHNI~ PUBLICATIONS•• An"" lhMI lot /in(1Wllld9e
& II -, Clcllt .. ,. hoJdl NCll\tly-
1cct1HCl web pages in its RA
It.,. -·· "' . .
1 Diak : N t I u 1-, ,ktl-ll1dlee ,lllp\dffi•
M,

lk 11Mr, video on demand server


&. 1 z ■ : Nd--. window aytllml, IUCh 11 X-11,
.
allow processes in ren,
cJ 11 f JI I ID . . . tlw, cm
wd ·of windows. .
S. p p p • N--►• pdnllll
acs:ept print jobs from many co
11 rs set 1 • mputers a
wlll\ a qllll1ing IJllem.
81 ........ :
L- . . : Wilt I l 81A ._,.11\Uldple clients to
sh are read-only page cont
H I -. .• • •'11114'111,ala d
l, ia tp share read-write files
.
- - • ~ IN lim
.- ld ll ll ll la
itl4ss. Shared whitebo
'1\ot • mmples of this type.
hl:Grd the definitive state of so
me re
. _ lllnce 'multi-user compute
rs appe
m t updates.
1DUel read-only copies of th
tlaoupout the Internet.
.. ._ an dlak and deliver the
r f
f ig. 1.16.5

Solution : Lampart clocks ·


2 <5 ~tnelC b -+ h,
3 ,,,. 4 but c -, g. :,3
P2
P1
0
(1 oo11 • a
(2 0 0) 2 t b

(3 0 0 I 3 • c p3 3)4 ~ ;
:; • .. [3 .! 3) 3 t I [ "' , 3]
(AOOJ 4 • d
I '
' '
Fig. 1.1 6.6
AU : M.19-15
IIM Physical Clock Synchronization : NTP
• Clock synchroruzation is done by two me~'1ods :
1. Internal synchroruzation
2. External synchronization

external synchronization
• External synchronization refers to synchronization of process clocks C 1 \Vith an
authontative external source S) Let D>O be the synchronization bound and S be
the source of CTC. Then lS{t) - Ci(t, <D for i = 1, 2, ... , N and for all real times t.
• We say that clocks C I are accurate -Y.ithin the bound of D
TECHNJC.A.L PUBLJCJ.T,O,JS - Jin up tr.~J.!1 f u r ~ ~
I

ti JUI•••• clocJcl C1 with each


,._. W Ct and c1 111 clock, at

.,,. . . . - llOt ftNlllldlY atlmllly


--of ,ro••,
-,., -1t .._, Ill dltft c:olllctlvtly
ti -,ndlronlztd
~ - · - • wlthlft bound 20.

:. C(t) that ii, • c1odc


dock ti.at
Atlock'1cruh
-_,flltan ii

l,oundaare

MPIL loYltr and upper

. . . m. 1ht ~
;-._.._totrlblmltm.
...,,_~Jllllll•t orJJ If tbl ~ II within I cert.1ri

a.& w, 311 • _,,_. ,err type alg rlth


-..aAf?~ ....... la~,-t"'_,. ., . o. m.
• 9- ..,,., ,ipdll' far _.,. t1w t1JM woWd be to ,unply JOsue a ••rno~
,...--...... - _.. and obWII the tline· .
• M all• n-- ta a a,ld,lnt with WWV rea,1ver, which receives P•ea,,
1

_, ..
IJIC.lt1C911d•--••--
t. A Moa _ . a nqi_.t to tlw
~

_..
07
d ta dia a,PffllUDI
tlJn! IJll5Vf!l al leul every d/2r 8eCOndi
~ aJJoWed ~ a clock and the UTC. '
a. n,, . . ••• _ . a nply -se with the CUJTl!RI UTC when receives U.
Nfld
& 'DI acJH •••--- the 1i1ne delay l,elWeell tiDle serve's ,sending u.
a P r md dia mzddM's Jlll!l1:iei,rin the _,,age. Then, ii uses the measure ~

., , .. dd-
~ - - . . . the cumnt ttDle from a tune ,erver.

lollToandT1 ............ wllhlhel8ffl8doCk


1o T
Cllfll---~-------~1 ----

--------------
........ Time_.

t.ff.t
Tt AN meuured using the same
.,_ • the ,ender's clock is off from

.. cr.o+Ti)/2
1
_.. •nr plus the tune tha
afftklS aB ~ -
- - - - - ,rill be ..-vaiJable. It

b tbne· The tune at each


to flCCOIJllt for network

. . . . tllM (including its

. . time of
in

will be
• tblla of
- affllet
t 4f

- N....- Time Protocol


• ~ • ~ , d M\\1 thl' U.r ktl• )
A~o rlth m "~ ln~ nde d for lntrnn'-?t •
8
• --flw Netwot\. TU M •~,.,vet
P'l'\,t\'X'\\l (NT I') ano thl! r met hod for syn<' hro nizl ng clocks
. . . \Ill a • I\M nl'd \k-. l arc hlt«
turv whe re the top level of the hicrMch
• . . . ~ to a UTC tim e 110\lrce 1uc. y
h R8 n GPS unit . •rt

- l.1a&11• AWflllnl Dlltrtbuttcl Atgortthm1


• lach aoclt exthanpe lta clock time wit h
its nel ghb on.

.. · ~
• 1""' _. hi dock time to the average of lte

. .
N IIL■ rk- ■ll6ol
ow n clock and the doc k times of its

,, :
l. 1111:h cl9 Ptl acrou the Int. ma t to be accurately syn
chr oni zed to UTC despite

..;z: : . .-Y lelt tha t can ,umve leng thy IOHN of con
nectivity.
C""an t k d'esfl lo lynchronl&e fNq uen tly and offN t the effe
cts of clock drif t.
6a PatrtOs "111DltCI\ ap iNt interference; auth
enti cate tha t the dat a is from a trusted
JI Pl
• 111111 NIP II vm ue COIIMClild In a logical hierarchy,
whe re servers in level n are
.l&sdly IO thole in level n-1 . The logical
hier arch y c.in be
ltlllr ■l bNDIM UNNChable or faile
d.
•••1•-• With one another In one of thre e mo des in the order 01

M N . . IN lm tt to be aynchronized
1a¥aNe . ,11. . . delaya encountered
~ T o ~ • milbl. s.n k, t~t can Aurvtv, lffl~thv l~'.H'fl of ronncdJ\.1ly
S. ~..._ clie nts to Mynchront e "Ulftdmtly, to ofket th!' rate of drift found
lftfflOlltl"OmpUtfta

'- To povict. inllrftrence with the time ur1t1 e, whcth r


protection •ma t
~ or acddental The time MrVk t utM 11uth#ntt tU.1 m te hruq es to
c:htck that tm\m8 data or;gtnatt from tN daimed tm~ted sour ~ It a~o
~ the ntum addl'flMt of fflffll8ft ,ent to u
• N'1P • • • synchronl&e modes an u follows :
1.. .... ...
I.~
S. s,ma .trkm ode.
i.•n at_ .:
• II M:Jll mode is intended for use on a high-speed LAN.
• Ole • &JR • vers periodically multicasts the time to the servers runrung m
....,.
. . . caarputers connectl!d by the LAN, which set their cloclcs assunung a small

but ones which nonetheless


ii 1111 aode mn only achieve relatively low accurate,
.., a rlf ed • ~ t for many purposes.
flu•• rn a• . . . :
.ftl u •me call mode is similar to the operation of Cristian's algorithm.
• :IJlllf eode. GIie Mter aa.-epts requests from other computers, which 1t pl'OC'eSSeS
tt•¥ fl,tc wlh • tia rrtamp-
ed
.... a1 :It ii Nls:NI whim higher accuracies are required that can be achiev
ar wt.e mullk:a,t is not supported in hardwue.
I! J Jfli ,. • • • on the NIM or a neighboring LAN, which need to keep
master sener m

-----
•tw ._.. thn for file a«r11•, c:ould contact a local

2111•:
.... II ••• drd for UN by the mute r eervers that supply time
ta U... 111d a,, 11w higher levela of the sync:h.roni.utian aubnet,
IC ;asAe • ID be achieved,
.... .... -,.m,tric mode exc han ge~ Warirlg timing

• put al an u1odation betweffl the eerven that is


Iha ll0CW"ICY of their 1ynchroruution over time,
UNIT II

Me naa eO rde rln g


and Sna psh ots

■I JS t
I C a,I ·• ~ • q Jf I · • • · . . ~ ~Syncn ro,u)JlS
_• • • •,. . . ' ,. I ~·
'
•tlc aitA ~w:kt NIII r ..... .,,,..,. °"Oft DS\"ffi':M O!'IOllS

-Gt f C ) - r..,,,,/ . . . f(nf .. ,..,,,, . . , . Gl,fill __. elftll .,,.,,s111,t


■z ,, M I I f ~er ..W. J ft.8 WJP■ SMp:, W,,~h msfor FIFO

O P 3SMJ
• • • UI Al I -QJ s
II Ml 1S1 R ·•--S)slc...... oa ■ m•lc•lrJft

A a Q n r ••A11m 1R11a u1 ~-••


■ .. . . . . . ............... _....... · · · · · · · · . · . · · · ,,,~ 6
f4-•4~ •1111 itlal1Flaw

J Pmffllc.....,.-a,._,
a,RFOCA■ 1lll

,, • f}
'\f 1,1,.. l~

~ 1hlr may be created and dt,troyed, P r ~ may JOffl (Jf

. - pre:e11■ may belong to mu1tip1, poupt,


pm¢111t1 to dta1 with coDectlont ol pr«-•• a, one abstraction
flOC•• lhould only lend a m••P to • group INS need not know oT
1191:la IIIIDlhera are.

--lllicatioft can be implemented in ,neral W"f',


2. Many to one 3. Many to 1111111

-1,y Cb MIider to multiple raiven.


ldw la alto known u J'llttJtic:Mt ~ A tpedal ca,e ol
- - - · .. bl'Oldcut COllllllUntcatlon.

,-0111• folllll a poup. ~ • ot two typa : CIOMd and

ie• 111 ...,_ of die poap Nlld a m•••P to the group.


C111
1{. . . . . . A mlN. to d,e pollJ) MI whoJe, although It
\¥"............. ot• gtoup.
• 1)1111: am Nlld • m ■r1p to the group as a

tw•-.. appllmllon.

'4 I I J

loallioll....,.....
. . . . . . . . . . . ti ..
. .tying .......
..... 111.,......
. . . . . . .-.i. . . . . . . .
. . . . be .,ndlranoul due to . . Wlutring

i .... pa«IIIIto wait until al thl -.twtng


. . . . . ..., - ready to JWIN dlf _, lkillt
...... _, mt N awaN of all IN _.Ylfts ~----~ tt,,.1


•·•·
•nNrret 1 ,ICHlfll' • not buttw.d for the ,_..tvln, pro, "lifi
- - • • proc111 II not tn a ••• ready to ,-,1v, It Thert!fc,r~, 11 ,tt
"'HI lb

.
aaus• a••·· I
■ I I ed GIiiy by 11'°91 proc11.,, of thtt multlc••• Aroup that ar~ rrncly

¥111411 .. bult.ffd for th• ~lvln,s


I proCl'IJ, I{) ,·,uh J•ffi(t ti
.r•
latl .. ••a*
II _.
··•1ttsc •two.,,.
....
•WJ•d paup wdl eventually ..-.tv• the m..1111•
WIida
of IIIIIAl\tkl for one--to-many communJcatlon,
• S Cla II 111 r ■ lla I A copy ol the mewp t, Hnt to each proci-11 of th~
■ •21t1 . . . and D'tlll . . . • buffertd until it t, accepted by tht proc~,,
I. 8 I 1 In sf t I •tlel a A • • • • to be multicat l, addlffHd
'1RQ11 di If••• 11111 ID, ffKJ lndlvtdual proc:NI of tM multicut group.
to a c.hnnnrl

t tlltl- la ■1111111 --• loatlon


I tfl Fl N ...... cliffeNnt depw of reliabWty.
--■■■ llkamlkP\. lht clepw of rellabWty t, normally exprc:••ll(•d 11,
1h ,, ' •
1 ltk e 1q 1h • II -,a1ld by the Nnder from any of the ttccivt•Ni
, Dia Jlwlll . . . . . a •pcne from any of the receiven.
t Ille mulltoeM poup COllltltl of n Neeiven and the ,endt·r
-•-·Q Can C n) of thl NCliven.
. . , . . I NlpGIIN lnllllp from all the recelven. l't

JEii • .,•
.. aurc ....... It II . . . received b~ All
,l...... ,,, . . it II not NCelvtKt t,\

- - plart
I p

................ ,,..
IMaf wd and If any°"' .-in the 1et

11111" • deltvtnd to all remven

. , , . , IO updatll tht same record ol a


. . . ol lht datab•e. U tht metNg£
Ill dt&illll orden, then th! fin.al
- ba dlffeae,t in ill two replicas.

Rt R2 S2

lft1

,. S2
:D:lstrli:,::bu::,:led::_:S~y_:st:em::':..__ _ _ _ _ _ _ _ _ _ 8_s_
2_._B _ _ _ _ _ _M sa
_r;_o_o_,_
c.11J_tli_nu_ ar=-
,a...,s_n;_;;a1,,t,,if
4

• Example : Oistributrd ~imulotion


• Dr•wbacks :
1. Too sttict con.,traint
2. No nbsolut<' ~ynchronircd clcxk
3. 'l' gunrnnt\;<.' ti, ratch nil trndy nwss,1g"s
Consistent I Total ordering
• h ensure:_- that all mt'ssagcs nrc delivered to all receiver processes in
order. the same
S1 R1 n; S2
• Fig. 2.4.3 show~ consistent ordering.
Ti I
• Rule : Messages received in the same
~rder, regardless of their timestamp.
• lmplement•tion : A message sent to a
sequencer, assigned a sequence number,
and finally multicast to receivers. A
message retrieved in incremental order at a
receiver. Fig. 2.4.3 Consistent orderfng
• Exunple : Replicated database updates
• Drawback : A centralized algorithm
Causal ordering
S1 R1 R2
• If two message sending events are not R3 S2
causally related, the two messages may
be delivered to the receivers in any
order.
• Two message sending events are said to
be causally related if they are correlated
by the happened before relation.
• Fig. 2.4.4 shows the causal ordering.
• Rule : Happened-before relation Fig, 2.4.4 Cauaal orderfng
k /
o If e\ e1i e h and k < I, then e i e e 1 1

If e,i = send(m) and e recef ve(m), then ei E e1,


o i:;;
1
o U e -+ e' and e' -+ e", then e ➔ e"
• Implementation : Use of a vector menage.
• Example : Distributed f1Je 11yatem

•• Drawbacks : 2. Broadcut 111wned


l, Vector as an overhead
__
matnx taggmg-tn--cm1""11'11;-,grc:,:i;.,......_ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
AU : May-lC)
Ill Total Order
re deln ered to nll rece1, er processes in the sazne
• It en...~res thnt all tn ;ag
order
• If l\ con-ect p ~ d hn.! m c-. gc m before it delh ers m', then any other correct
, dch, ts ; w-ill deli, er m before m'.
• F1g lcb.1 '-!,, rons1~tent ordcnng.
S1 R1 R2 S2

Fig. 2.6.1 Consistent ordering

• For each pair of processes Pi and Pi and for each pair of messages ~1 x and M,
that are delivered to both the processes, Pi is delivered l\t, before t--1} if and only
if P1 is delivered Mx before My
0 Rule: Messages received in the same order, regardless of their timestamp.
0 Implanenution : A message sent to a sequencer, assigned a sequence number,
and finally multicast to receivers. A message retrieved in incremental order at a
~ver.
c Example: Replicated database updates
• Drawback : A centralized algorithm

TECHNICAL PUBLICATIONS • An up thtu$1 for l l n o ~


~-~.;...-----------...::.2..:_·.:_11:.._ __~_ _ _M_es_s_sg_e_O_rd_e_rlng~a_nd_S_n_s_psh_ots
- ThrM Phase Distributed Algorlthm
s-ter:
• Phase 1 : Process multicast the mcssngc M with a locally unique tag and the local
time stamp to the group members.
• ~ 2 : The sender process awaits a reply from all the group metnbe1s who
respond with a tentative proposal for a revised timestamp for that message.
• Phase 3 : The process multicasts the final timestamp to the group in line.
lleceivers:
• Phase 1 : Receiver receives the message with a tentative timestamp. It updates the
variable priority.
• ~ 2: The receiver sends the revised timestamp back to the sender.
• Fmal timestamp is received from the multi-caster.
Ill Id Pr
••• _ ff..llrff
p,ot IIHI -Nk, I ~ 1<"./>-t,f, ,

.. died• pafonned by a t1it-: ~ 1

. ..,. nor a Joe-al kemet an bf.


. . odur;m hat io hr
• • ol ~ met•age

a,,oiw, IOCf!lf maced 1e60U:~ ,


..,_...,s . . . . . . in - aitial ~
.......... l«tioJ ..,
to an 1/0 dmce

.........
.... ILJMd ,ylteM where.·

•ct.bibutedsy,tem.
fllllf!dlinaa:g die critical &ection
illlilllllnerufion

. , ..

me,sage

' .......
o,ti.mpc,ritiprldun
f.wO .,,. ol ffldllP' ! REQUt91
- ~A

• lolloeJ dock whkh it updated lf!(urdJ, ~ b


- • - of awqu,tt,. ~ueffl are u,d~t"-j
IJIShfflP'; if dfflltWT1P9 are equal, j'llef.et

-
O ~ dw requnt ~a~ tu all utl~1
.,..,., Ptoe1111 it allowed to ~ntn lf!f! c~
• • •, ..., 111, reque,t tnn811ge (Ull5i3lc; ;A
t11ak)andit,~;
. . CS : awll••t requnted, ur hel<l

•dbl, it broadcast time,tamped

I may be tn one of three statts


11db\, Nl1d reply (OK) to fJCllder
reply and add the reque,t w •

ha ,ent its requcsl In


ltWld ...- p with the one that
, it sends a reply
lt II the winner and doc,

1111111111! JllPLY mettage from aU


/J/811/lml• d M11/1JXancl ()ttlltlf",;k

,ttt St f>Ottl th, cs,


tiMtRl.
II llt•1,,h, ,m, p/V,I!(() ""'"'JflKIJII lo ,,11 11itC!t in its
tlte SI ~lVet1 th,, l{Bl.HASL(i) ll lll'lld" fl t<t!PLY(J)
11w10111w1 Il'lllll t11!1,,
the nC?xt t1lh_l Wallin~ 111 tlw
q11p111• 111111 d1•l1•1t·<1 tlwt 1•11try from th c
, the queue is tmpty, lhl'II lhti 1111,, upd,1h•11 ll11 ,.,ntf! to n:fli•ct thnt the
not k.-nt llUt nny NBPLY tnt'Ht4,tgP,

.:- . lite Si has r«elved REPLY J\ll'~Mgl• from n Hih• Sj, tlw uutho_riz:ition
ft
~ t in this message remainfl VAiid lmtll ~l !ll'nd~ n REPLY 11u:t1!l,1gc to SJ,
11• S,4.1 shows operation of Rkart-Agrawnln nlgorllhm .
• J"'O'
, • sue 51 and S2 are making request for criticnl IIC'Ction.
- 1.

Fig. 3.4.1 (a)


i lle 52 enters the critical section.

'-~enters
crt11catuctlon

,... U.1 (ia»


f

nn n
\
53 '. sz 1,avos
cr,tlcnl soctlon

Fig, 3.4.1 (c)

Step 4 : Site 51 enters the critical section


S1 enters ,
critical section ' \
I

rl
s,nn n n Fig. 3.4.1 (d)

Review Question

1. Write short note on the following : Ricart and Agrawnla's algorithm.


AU : Mav-16. M&!~• I

IIJ Maekawa's Algorithm


• The main idea of the algorithm is to Jet the process that want to enter the cr1tic1·
section to compete for votes. Every process P has a voting district Sp H ,;
required that for all i and j, Si and SJ have at lcacit one common clcrnent.
• When a process wishes to enter the critical tiection, it sends a vote rcq\1 C!t t<> e11ef'J'
member of its voting district. When the processor receives rcpHe, from aU ~
. . l ·t ccefvtJ
members of the d 1str1c , 1 can enter the critical section. When n prcxe;.,501 r
-------~~~:-- -----------___..,
TECHNl~l PUSLICl<TIONS , An up fhrwt /er ~ I J
3 • 11
-' got/! request, it respo d Dlstrtbutad Mutex ,ind oeadtock

n s criti
w· h
~voe
tfld' or other
a processor the
cand'd
. . exits itca1asectioi
· . . tf
"YES" vote . il has not • 1ready ca,twhich
its vote.
ates ,, it mforms tl,e voting
· district,
· can
t f 1

~E Pi Vi is.• chosen
• 1 Pi process Pi
A 1s ass
su oc1ated
. : • a votint set Vt of processes. The set Vi for the
. ch that with
. . process is in its ownv ·
2, Vi/"\ Vi
voMS ~ts
* ·{ J . The . oting ocess
set. m the overlap between any two
. re is at least one pr .

e e same size
3. ~.11 voting sets ar th
IVi I : I Vj I:
4. Eac process Pi is conta·med within . M . ·
• WheJ'\ h
aie,nbetS
a processor wants
of its district It mt o enter a cntic · voting
· al section,
.
sets. . sends a request to all
ti
· t ay
processor receives a reque
()n exit it informs its d' u:
.t enter' if it .gets a grant fr otn all members. When a
1 answers wi
th yes, if it has not already cast its vote.
ct to enable a new voting,
15
• As 1,efore each process ,naintainS a state variable which can be one of the

1- Released : Does not have access to the critical section and does not reqUlle ,t.
following:
2. wanted : J)oeS not have access to the critical section but does require it.

• S. }leld : currently
Ill addition haS access to the critical section.
each process ,naintainS a boolean variable indicating whether or not
the pfOCt!SS haS "voted". Of course voting is not a one-time action. This variable
really ;ndicateS whether some process within the voting set has access to th•
(litical section and haS yet to release it. To begin with, thes• variables are set to

~ " and False respectively.

· 1, Question
J. Wrift s/Wrl nolt on ~ fallaVJi"g : ~ • • vofing algorithm. ff Mi/ · :11

suzukl-Kasaml'•
. . the access
9,oadcast Algortthrn
right to the sh ared resource is passed in a
i/!I ,;Lotpral token represer'tiJ>S ~~-· whoever holds the token is allowed to

,,..tlld
~ eritieal ~
fas)iiol'sectiorL
l
the pro---~
· all . ,
,n,Ol!S 51teS•
.,..;.
.1.1....,.
means a sequence nuinbet is u..sed
P2P and Distributed
Shared Memory

Introduction - Data indexing and <J\lerlays - Chord - Content addressable networks - Tapestry.
""'1fbldetl shared mmwry: Ab1traction and advantages - Memory consistency models -Shared
,nawny Mutual Exclusion.

Contents
8
5-1 Introduction of Peer-to-Peer Computing .... . . May-16, 17, 18, Dec.-17, · ·· Marks
5.2 Data Indexing and Overlays .......... . .. .. May-16, 17, 18, 19,
................ . . Dec.-16, 18 · · · · · · · · · · · Marks 13

5.3 Chord
5.4 Content Addressable Network
5.5 Tapestry
· \Jlll..6 Dlstrib·.,-"'
uun, Shared Memory . . . . . . . . . . . . . . . Dec.•18' · · · · · · · · · · · · · · Marks 8

5. 7 DSM Architecture
5.8 Design Issue In DSM
5.Q Memory Consistency Models
5.10 Shared Memory Mutual Exclusion
Two Marlcs Questions with Answers

(5 - 1)

You might also like