1 / 59

Flat Committed Join in Join

Flat Committed Join in Join. Hern á n Melgratti joint work with Roberto Bruni and Ugo Montanari Dipartimento di Informatica - Università di Pisa. Committed Join (cJoin). Join + primitives for negotiations Syntax:. P,Q ::= 0 | x  ŷ  | def D in P | P|Q D,E ::= J  P | D E

kaori
Télécharger la présentation

Flat Committed Join in Join

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Flat Committed Join in Join Hernán Melgratti joint work withRoberto BruniandUgo Montanari Dipartimento di Informatica - Università di Pisa

  2. Committed Join (cJoin) • Join + primitives for negotiations • Syntax: P,Q ::= 0 | xŷ| def D in P | P|Q D,E ::= JP | DE J,K ::= xŷ | J|K Processes Definitions Patterns Workshop Finale Cometa – Dec, 2003

  3. Committed Join (cJoin) • Join + primitives for negotiations • Syntax: Messages M,N::= 0 | xŷ | M|N P,Q ::= 0 | xŷ| def D in P | P|Q D,E ::= JP | DE J,K ::= xŷ | J|K Processes Definitions Patterns Workshop Finale Cometa – Dec, 2003

  4. Committed Join (cJoin) • Join + primitives for negotiations • Syntax: Messages M,N::= 0 | xŷ | M|N P,Q ::= M| def D in P | P|Q D,E ::= JP | DE J,K ::= xŷ | J|K Processes Definitions Patterns Workshop Finale Cometa – Dec, 2003

  5. Negotiation Compensation Committed Join (cJoin) • Join + primitives for negotiations • Syntax: Messages Programmable abort M,N::= 0 | xŷ | M|N P,Q ::= M| def D in P | P|Q | abort|[P:Q] D,E ::= JP | DE | JP J,K ::= xŷ | J|K Processes Definitions Patterns Merge definition Workshop Finale Cometa – Dec, 2003

  6. Committed Join (cJoin) • Operational Semantics (CHAM Style): heating and cooling reaction Workshop Finale Cometa – Dec, 2003

  7. Committed Join (cJoin) • Operational Semantics (CHAM Style): Contract P evolves in isolation Compensation Q is kept frozen Workshop Finale Cometa – Dec, 2003

  8. Committed Join (cJoin) • Operational Semantics (CHAM Style): Global Resources Commit Workshop Finale Cometa – Dec, 2003

  9. Committed Join (cJoin) • Operational Semantics (CHAM Style): Compensation on Abort Workshop Finale Cometa – Dec, 2003

  10. Committed Join (cJoin) • Operational Semantics (CHAM Style): Merge n ongoing contracts Workshop Finale Cometa – Dec, 2003

  11. Example: Mailing List ML MailingListk  MLDef Workshop Finale Cometa – Dec, 2003

  12. Example: Mailing List ML MailingListk  MLDef MLDefdef …  in kadd, tell, close | lstnil Workshop Finale Cometa – Dec, 2003

  13. Example: Mailing List ML MailingListk  MLDef MLDefdef …  lsty | addx  …  lsty | tellv  …  lsty | close   … in kadd, tell, close | lstnil Workshop Finale Cometa – Dec, 2003

  14. Example: Mailing List ML MailingListk  MLDef MLDefdef …  lsty | addx  def zv,w  xv | yv,w in lstz  lsty | tellv  …  lsty | close   … in kadd, tell, close | lstnil Workshop Finale Cometa – Dec, 2003

  15. Example: Mailing List ML MailingListk  MLDef MLDefdef …  lsty | addx  def zv,w  xv | yv,w in lstz  lsty | tellv  [def w  0 in yv,w| lsty : lsty]  lsty | close   … in kadd, tell, close | lstnil Workshop Finale Cometa – Dec, 2003

  16. Example: Mailing List ML MailingListk  MLDef MLDefdef nilv, w  0  lsty | addx  def zv,w  xv | yv,w in lstz  lsty | tellv  [def w  0 in yv,w| lsty : lsty]  lsty | close   … in kadd, tell, close | lstnil Workshop Finale Cometa – Dec, 2003

  17. Example: Mailing List ML MailingListk  MLDef MLDefdef nilv, w  0  lsty | addx  def zv,w  xv | yv,w in lstz  lsty | tellv  [def w  0 in yv,w| lsty : lsty]  lsty | close   0 in kadd, tell, close | lstnil Workshop Finale Cometa – Dec, 2003

  18. Implementing flat cJoin • Goal • To implement cJoin in Join • Key Points • Distributed commit of interacting negotiations as a global decision • Participants can join dynamically (participants statically unknown) • First step • Consider flat negotiations • Use canonical form of processes • Encode canonical flat cJoin processes as Join processes Workshop Finale Cometa – Dec, 2003

  19. Flat cJoin • Negotiations cannot be nested • Type system for cJoin Processes: • P: 0, P does not contain [_:_] at all • P: 1, P may contain [_:_] in the definitions • P: 2, P may have and generate flat negotiations • Join Processes have type 0 • Subject Reduction holds for 0 and 2 • Flat cJoin: The sub-calculus of all P:2 Workshop Finale Cometa – Dec, 2003

  20. Canonical Flat cJoin • Inspired by the basic shapes of ZS nets • Few elementary definition patterns • Any flat process can be written in canonical form Workshop Finale Cometa – Dec, 2003

  21. Has type 2 • lsty | tellx  ay,x • ay,x  [def w  0 in yv,w| lsty : lsty] Has count = 2 ay,x  [def w  0 in def bv,w,l,y yv,w| ly in bv,w,lst,y : lsty] Canonical Form: Example def nilv, w  0  lsty | addx  def zv,w  xv | yv,w in lstz  lsty | tellv  [def w  0 in yv,w| lsty : lsty]  lsty |close   0 in kadd, tell, close | lstnil Workshop Finale Cometa – Dec, 2003

  22. Encoding: Main Idea • Any message in a negotiation runs in a thread, which is managed by a coordinator • Coordinators perform a D2PC protocol [BLM2002]. • A variant of the decentralized 2PC with a finite but unknown number of participants • When a participant P is ready to commit it has only a partial knowledge of the whole set of participants • Only those who directly cooperated with P • To commit P must contact all its neighbors and learn the identity of other participants from them Workshop Finale Cometa – Dec, 2003

  23. Encoding: D2PC • Every participant P acts as coordinator • During the transaction P builds its own synchronization set LP of cooperating agents • When P is ready to commit, P asks readiness to processes in LP (if empty P was isolated and can commit) • In doing so, P sends them the set LP • Other participants will send to P • either a successful reply with their own synchronization sets • or a failure message • (in this case, failure is then propagated) • Successful replies are added to LP • The protocol terminates when LP is transitively closed Workshop Finale Cometa – Dec, 2003

  24. Encoding a negotiation [def z  0 in z : 0] Workshop Finale Cometa – Dec, 2003

  25. Encoding a negotiation [def z  0 in z:0] A negotiation with one thread Workshop Finale Cometa – Dec, 2003

  26. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z  0 in z:0] A negotiation with one thread A coordinator Dto manage z def D Workshop Finale Cometa – Dec, 2003

  27. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z  0 in z : 0] def D Compensation Workshop Finale Cometa – Dec, 2003

  28. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z  0 in z : 0] Set initial compensation def D cmp 0 in state {cmp} Compensation Workshop Finale Cometa – Dec, 2003

  29. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z  0 in z: 0] def D cmp0 in state {cmp} z runs in a managed thread Workshop Finale Cometa – Dec, 2003

  30. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z  0 in z: 0] z carries the ports of its coordinator def D cmp0 in state {cmp} | | def … pl, ,  inzput, abt, {lock} z runs in a managed thread Workshop Finale Cometa – Dec, 2003

  31. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z 0 in z : 0] def D cmp0 in state {cmp} | | def … inzput, abt, {lock} It consumes managed msgs Workshop Finale Cometa – Dec, 2003

  32. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z 0 in z : 0] z carries the ports of its coordinator def D cmp0 in state {cmp} | | def zp, a, l  … inzput, abt, {lock} It consumes managed msgs Workshop Finale Cometa – Dec, 2003

  33. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z 0in z : 0] def D cmp0 in state {cmp} | | def zp, a, l  … inzput, abt, {lock} The thread ends Workshop Finale Cometa – Dec, 2003

  34. Encoding a negotiation • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z 0in z : 0] D can commit def D cmp0 in state {cmp} | | def zp, a, l  pl, ,  inzput, abt, {lock} The thread ends Workshop Finale Cometa – Dec, 2003

  35. Encoding an abort • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z abortin z : 0] def D cmp0 in state {cmp} | | def zp, a, l  … inzput, abt, {lock} The thread aborts Workshop Finale Cometa – Dec, 2003

  36. Encoding an abort • put: to notify thread completion • abt: to notify thread abortion • lock: to receive partners’ confirmations • state: to set the initial compensation [def z abortin z : 0] D aborts def D cmp0 in state {cmp} | | def zp, a, l  a inzput, abt, {lock} The thread aborts Workshop Finale Cometa – Dec, 2003

  37. Encoding: Fork and Join x  y|z Workshop Finale Cometa – Dec, 2003

  38. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 Workshop Finale Cometa – Dec, 2003

  39. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} Workshop Finale Cometa – Dec, 2003

  40. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} | pl{lock1,lock2}, {abt1,abt2} , Workshop Finale Cometa – Dec, 2003

  41. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} | pl{lock1,lock2}, {abt1,abt2} , | state1{a,abt2} | state2{a,abt1} Workshop Finale Cometa – Dec, 2003

  42. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} | pl{lock1,lock2}, {abt1,abt2} , | state1{a,abt2} | state2{a,abt1} x|y  z Workshop Finale Cometa – Dec, 2003

  43. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} | pl{lock1,lock2}, {abt1,abt2} , | state1{a,abt2} | state2{a,abt1} yp2,a2,l2  def D x|y  z xp1,a1,l1| Workshop Finale Cometa – Dec, 2003

  44. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} | pl{lock1,lock2}, {abt1,abt2} , | state1{a,abt2} | state2{a,abt1} yp2,a2,l2  def D in zput, abt1,l1 l2{lock} x|y  z xp1,a1,l1| Workshop Finale Cometa – Dec, 2003

  45. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} | pl{lock1,lock2}, {abt1,abt2} , | state1{a,abt2} | state2{a,abt1} yp2,a2,l2  def D in zput, abt1,l1 l2{lock} | p1 l1 l2{lock}, {abt,a2} , | p2 l1 l2{lock}, {abt,a1} , x|y  z xp1,a1,l1| Workshop Finale Cometa – Dec, 2003

  46. Encoding: Fork and Join x  y|z xp,a,l  def D1  D2 in yput1, abt1,l{lock1,lock2} | zput2, abt2,l{lock1,lock2} | pl{lock1,lock2}, {abt1,abt2} , | state1{a,abt2} | state2{a,abt1} yp2,a2,l2  def D in zput, abt1,l1 l2{lock} | p1 l1 l2{lock}, {abt,a2} , | p2 l1 l2{lock}, {abt,a1} , | state{a1,a2} x|y  z xp1,a1,l1| Workshop Finale Cometa – Dec, 2003

  47. Encoding: Names [def zx xx in zy: 0] Workshop Finale Cometa – Dec, 2003

  48. Encoding: Names [def zx xx in zy: 0] [def zx  xx in yy: 0]  Workshop Finale Cometa – Dec, 2003

  49. Encoding: Names [def zx xx in zy: 0] [def zx  xx in yy: 0]  [yy | def zx  xx in 0: 0] * Workshop Finale Cometa – Dec, 2003

  50. Encoding: Names [def zx xx in zy: 0] [def zx  xx in yy: 0]  [yy | def zx  xx in 0: 0] * yy  Workshop Finale Cometa – Dec, 2003

More Related