semantics of orc
play

Semantics of Orc William Cook and Jayadev Misra f cook,misra g - PowerPoint PPT Presentation

D EPARTMENT OF C OMPUTER S CIENCES Semantics of Orc William Cook and Jayadev Misra f cook,misra g @cs.utexas.edu Department of Computer Science University of Texas at Austin Email: web: http://www.cs.utexas.edu/users/psp U NIVERSITY OF T EXAS


  1. D EPARTMENT OF C OMPUTER S CIENCES Semantics of Orc William Cook and Jayadev Misra f cook,misra g @cs.utexas.edu Department of Computer Science University of Texas at Austin Email: web: http://www.cs.utexas.edu/users/psp U NIVERSITY OF T EXAS AT A USTIN 0

  2. D EPARTMENT OF C OMPUTER S CIENCES Outline � Define an asynchronous semantics, using labeled transitions. � Refine asynchronous semantics to a synchronous semantics. An expression transits to another expression, causing an event. Labels are events. U NIVERSITY OF T EXAS AT A USTIN 1

  3. D EPARTMENT OF C OMPUTER S CIENCES f ; g ; h 2 E xpr M ( P ) Formal Syntax j j E ( P ) j j f > x > g j j f j g j j f where x : 2 g ::= Site call Expression call p 2 A tual x j j j j M Sequential composition Symmetric composition q 2 F or mal x j j M Asymmetric composition ::= ::= U NIVERSITY OF T EXAS AT A USTIN 2

  4. D EPARTMENT OF C OMPUTER S CIENCES ? u and l et ( ) as two possible expressions. Enhanced Syntax f ; g ; h 2 E xpr M ( P ) j j E ( P ) j j f > x > g Add j j f j g j j f where x : 2 g ::= Site call j j ? u Call to definition j j let ( ) Sequential composition Symmetric composition Asymmetric composition Waiting for response Ready to Publish U NIVERSITY OF T EXAS AT A USTIN 3

  5. D EPARTMENT OF C OMPUTER S CIENCES Events l 2 E v ent M h ; u i u j j u ? j j y There are 4 kinds of events. j j � ::= Site call with handle Response publish silent transition Response is outside the control of Orc. U NIVERSITY OF T EXAS AT A USTIN 4

  6. D EPARTMENT OF C OMPUTER S CIENCES u fresh Rules for Site Call M h ;u i M ( ) , ! ? u u ? (S ITE C ALL ) ? u , ! let ( ) y let ( ) , ! 0 (S ITE R ET ) (L ET ) U NIVERSITY OF T EXAS AT A USTIN 5

  7. D EPARTMENT OF C OMPUTER S CIENCES l 0 f , ! f Symmetric Composition l 0 f j g , ! f j g l 0 g , ! g (S YM 1) l 0 f j g , ! f j g (S YM 2) U NIVERSITY OF T EXAS AT A USTIN 6

  8. D EPARTMENT OF C OMPUTER S CIENCES l 0 f , ! f l 6 = y Sequencing l 0 f > x > g , ! f > x > g y 0 f , ! f (S EQ 1N) � 0 f > x > g , ! ( f > x > g ) j [ =x ℄ g (S EQ 1V) U NIVERSITY OF T EXAS AT A USTIN 7

  9. D EPARTMENT OF C OMPUTER S CIENCES l 0 f , ! f l 6 = y Asymmetric Composition l 0 g where x : 2 f , ! g where x : 2 f y 0 f , ! f (A SYM 1N) � g where x : 2 f , ! [ =x ℄ g l 0 g , ! g (A SYM 1V) l 0 g where x : 2 f , ! g where x : 2 f (A SYM 2) U NIVERSITY OF T EXAS AT A USTIN 8

  10. D EPARTMENT OF C OMPUTER S CIENCES [[ E ( q ) � f ℄℄ 2 D Expression Call � E ( p ) , ! [ p=q ℄ f (D EF ) U NIVERSITY OF T EXAS AT A USTIN 9

  11. D EPARTMENT OF C OMPUTER S CIENCES Rules U NIVERSITY OF T EXAS AT A USTIN 10

  12. l u fresh 0 f , ! f l 6 = y M h ;u i l 0 M ( ) , ! ? u f > x > g , ! f > x > g D EPARTMENT OF C OMPUTER S CIENCES u ? y 0 ? u , ! let ( ) f , ! f � 0 y f > x > g , ! ( f > x > g ) j [ =x ℄ g let ( ) , ! 0 l 0 l f , ! f l 6 = y 0 f , ! f l 0 l g where x : 2 f , ! g where x : 2 f 0 f j g , ! f j g y 0 l 0 f , ! f g , ! g � l g where x : 2 f , ! [ =x ℄ g 0 f j g , ! f j g l 0 g , ! g [[ E ( q ) � f ℄℄ 2 D � l 0 E ( p ) , ! [ p=q ℄ f g where x : 2 f , ! g where x : 2 f U NIVERSITY OF T EXAS AT A USTIN 11

  13. D EPARTMENT OF C OMPUTER S CIENCES Pending Event � transform the expression, At any moment, there is a set of pending events. Processing a pending event may � change the set of pending events. U NIVERSITY OF T EXAS AT A USTIN 12

  14. D EPARTMENT OF C OMPUTER S CIENCES M ( x ) where x : 2 N j R , both N h u i and R h v i are pending. Example of Event Processing N h u i M ( x ) where x : 2 N j R , ! M ( x ) where x : 2 ? u j R R h v i is still pending. So are u ? x , for all x . In u ? M ( x ) where x : 2 ? u j R , ! M ( ) R h v i and u ? x are no longer pending. After U NIVERSITY OF T EXAS AT A USTIN 13

  15. D EPARTMENT OF C OMPUTER S CIENCES Rules for Event Processing � (Fairness) If there is an internal pending event, some pending event is � (Asynchrony) Order and timing of event processings are arbitrary. processed eventually. U NIVERSITY OF T EXAS AT A USTIN 14

  16. D EPARTMENT OF C OMPUTER S CIENCES Notes on Event Processing � Fairness is minimal progress. It does not say that: � Only internal events are under client’s control. � If there are only external pending events, no event may be processed. an event which remains pending is eventually processed. U NIVERSITY OF T EXAS AT A USTIN 15

  17. D EPARTMENT OF C OMPUTER S CIENCES Examples � let ( x ) where x : 2 let (0) j R timer (1) � R R ’s response, if any, is never fully processed. � (Fairness) Metr onome � ( l et (0) j l et (1)) If it publishes 0, � (Asynchrony) let ( x ) where x : 2 let (0) j R timer (1) � l et (1) May publish 0 forever. may publish 0 or 1. U NIVERSITY OF T EXAS AT A USTIN 16

  18. D EPARTMENT OF C OMPUTER S CIENCES Synchronous Semantics l 2 A tion M h ; u i u Specify time (and order) of event processing. j j y l et ( ) is internal j j � Internal event (action): u ? ::= Site call with handle publish; silent transition External Event (response): Rule 1: Process a response only if there is no action. Order among internal events is arbitrary. Order among external responses is arbitrary. U NIVERSITY OF T EXAS AT A USTIN 17

  19. D EPARTMENT OF C OMPUTER S CIENCES let ( x ) where x : 2 let (0) j R timer (1) � l et (1) Examples let ( x ) where x : 2 let (0) j let (2) j R timer (1) � l et (1) let ( x ) where x : 2 if ( true ) � let (0) j R timer (1) � l et (1) let ( x ) where x : 2 R timer (1) � let (0) j R timer (2) � l et (1) (1) (2) (3) (4) (1) publishes 0. (2) publishes 0 or 2. (3) publishes 0 or 1. (4) publishes 0 or 1. U NIVERSITY OF T EXAS AT A USTIN 18

  20. D EPARTMENT OF C OMPUTER S CIENCES Handle Time let ( x ) where x : 2 R timer (1) � let (0) j R timer (2) � l et (1) Rule 2: Process events as soon as possible. Assume event processing is instantaneous. (4) publishes 0. U NIVERSITY OF T EXAS AT A USTIN 19

  21. D EPARTMENT OF C OMPUTER S CIENCES Immediate/deferred Sites let , if , add , or , � � � � Designate certain sites as immediate, rest as deferred. R timer , CNN � � � An immediate site has to respond instantaneously. Immediate Sites: let ( x ) where x : 2 if ( true ) � let (0) j R timer (1) � l et (1) Deferred Sites: Rule 3: A response from an immediate site is an internal event. (3) publishes 0. U NIVERSITY OF T EXAS AT A USTIN 20

  22. D EPARTMENT OF C OMPUTER S CIENCES Positive/Negative Response � positive response: a result value, written as u ? , or An immediate site responds immediately with � negative response: that it will be silent, written as u ?? u ?? ? u , ! 0 (S ITE R ET ) U NIVERSITY OF T EXAS AT A USTIN 21

  23. D EPARTMENT OF C OMPUTER S CIENCES Summary of Rules for Synchronous Semantics � Process a response only if there is no action. � Process events as soon as possible. � A response from an immediate site is an internal event. U NIVERSITY OF T EXAS AT A USTIN 22

  24. D EPARTMENT OF C OMPUTER S CIENCES Formal definition of Synchronous Semantics � Define quiescent expression, QE xpr , one that has no internal event. � Define non-quiescent expression, NExpr , its complement. , ! : Expr � Event � Expr f Defined earlier g r r , ! R : QExpr � R esp onse � Expr = f ( q ; r ; e ) j q , ! e g a a , ! A : NExpr � A tion � Expr = f ( q ^ ; a; e ) j q ^ , ! e g l l l , ! S : Expr � Event � Expr = , ! R [ , ! A U NIVERSITY OF T EXAS AT A USTIN 23

  25. D EPARTMENT OF C OMPUTER S CIENCES Round-based Execution � A round consists of processing internal events. This includes calls to � A round ends when no more internal events can be processed. � First round starts at the beginning of evaluation. and responses from immediate sites. � Subsequent rounds start by processing a response from a deferred site. U NIVERSITY OF T EXAS AT A USTIN 24

  26. D EPARTMENT OF C OMPUTER S CIENCES Laws of Kleene Algebra j ) f j 0 = f j ) f j g = g j f j ) ( f j g ) j h = f j ( g j h ) j ) f j f = f � ) ( f � g ) � h = f � ( g � h ) (Zero and � ) 0 � f = 0 (Commutativity of � ) f � 0 = 0 (Associativity of � ) S ig nal � f = f (Idempotence of � ) f > x > let ( x ) = f (Associativity of � over j ) f � ( g j h ) = ( f � g ) j ( f � h ) (Left zero of � over j ) ( f j g ) � h = ( f � h j g � h ) (Right zero of (Left unit of (Right unit of (Left Distributivity of (Right Distributivity of U NIVERSITY OF T EXAS AT A USTIN 25

  27. D EPARTMENT OF C OMPUTER S CIENCES j ) f j f = f Laws which do not hold � ) f � 0 = 0 � over j ) f � ( g j h ) = ( f � g ) j ( f � h ) (Idempotence of (Right zero of (Left Distributivity of U NIVERSITY OF T EXAS AT A USTIN 26

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend