1 / 20

CIS 725

CIS 725. Lecture 2. Finite State Machine Model. FSM = (A, S, T, s 0 ) A = set of actions S = set of states s 0 = initial states T = transition relation S * A  S. Communicating FSM. send actions: -m or !m q ! m = send message m to q

Télécharger la présentation

CIS 725

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. CIS 725 Lecture 2

  2. Finite State Machine Model • FSM = (A, S, T, s0) A = set of actions S = set of states s0 = initial states T = transition relation S * A  S

  3. Communicating FSM • send actions: -m or !m q ! m = send message m to q • receive actions: +m or ? m q ? m = receive message from q • internal actions

  4. Protocol • A collection of CFSMs

  5. Asynchronous coupling • Channels ch1 = channel from M to N ch2 = channel from N to M • Global state: (q1, q2, x, y) q1 = state of M q2 = state of N x = messages in transit to M y = messages in transit to N

  6. Protocol actions • Each protocol action results in a change in the global state

  7. Error states • Deadlock states: - state from which no transition is enabled • Unspecified reception: - a state in which a message exists in a channel but no transition is enabled in the state to receive it.

  8. studying studying !meeting waiting Meeting appointment • - Initial state: studying • Send a message for meeting • May decide to cancel anytime ?OK meeting

  9. Two-process mutual exclusion: Token ring protocol • Single token circulates among two nodes • Node with the token can enter the critical section

  10. Request-based Token ring protocol - To get the token, send a request to the other node

  11. no_token no_token !req !req ?token ?token !token req_sent req_sent enter enter enter exit exit exit ?req token & req_recd token token ?req in_cs in_cs& req_recd in_cs Request-based Token ring protocol

  12. Programming language style notation • Guarded actions • en(a)  a en(a): guard of the action boolean condition or boolean condition + receive statement

  13. Normal form • init; do en(a1)  a1 [] en(a2)  a2 : : od

  14. Token-based system • P1: hold = false; in_cs = false do ? token  hold = true [] hold /\ not in_cs  ! Token; hold =false [] hold  in_cs = true [] in_cs  in_cs = false od

More Related