Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 CIS 725 Lecture 2

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

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

8

9

10 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.

11

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

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

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

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

16

17

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

19 Normal form init; do en(a 1 )  a 1 [] en(a 2 )  a 2 : od

20 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


Download ppt "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."

Similar presentations


Ads by Google