1.10 Model 3: Message-Passing Text - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

1.10 Model 3: Message-Passing Text

Description:

For buffered communication, we add a new variable to the set of state variables ?. ... No buffering ... With unbounded buffering. But the channel should never ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 14
Provided by: eceU3
Category:

less

Transcript and Presenter's Notes

Title: 1.10 Model 3: Message-Passing Text


1
1.10 Model 3 Message-Passing Text
  • We saw
  • Diagrams
  • Shared-variables text
  • Now
  • Message-passing text (like CSP)

2
  • In the communication statements,
  • we name a channel,
  • and not the communication partner directly.
  • This naming convention
  • Leads to better encapsulation of processes,
  • Allows many-to-many communication through a
    single channel.

3
  • Modifications to shared-variables text language
  • Disallow the use of shared variables, omit
    synchronization statements based on them
  • Add new communication statements based on msg
    passing.

4
Communication statements
  • Channel dcl.
  • Send
  • Receive
  • p. 71

5
Buffering capability
  • Unbounded buffering (async)
  • Bounded buffering (async)
  • No buffering (sync)
  • The usual convention in buffering keeping the
    order of sending messages.

6
  • For buffered communication, we add a new variable
    ? to the set of state variables ?.
  • The domain of this variable ? consists of lists
    of elements of the declared type.
  • Transition relations in p. 72, 73

7
  • No buffering
  • Two parallel statements are considered to be
    matching if they form a send and receive pair on
    the same channel.
  • When two matching statements are jointly ready to
    execute, their execution is atomic and
    simultaneous and the effect is equivalent to an
    assignment statement.
  • P. 74

8
  • No buffering is not the same as buffering with
    N0
  • Buffering with N0 does not allow any send
    statement to be executed.
  • (not the case in Promela)
  • See Fig. 1.15, p. 76
  • Problem 1.6

9
  • Three examples for producer-consumer
  • With bounded buffering
  • Fig. 1.16, p.77
  • With unbounded buffering
  • But the channel should never hold more than N
    pending message
  • Fig. 1.17, p.78
  • Conditional communication statement
  • An additional statement

10
Conditional communication statement
  • Conditional send and receive
  • P. 79
  • Async communication
  • Sync communication
  • Example Prod-cons without buffering
  • Fig. 1.19, p. 81
  • Problem 1.7

11
Comparison of sync and async models
  • We could implement an async problem, using sync
    constructs
  • By introducing a process as a channel
  • Sync communication is a more primitive concept
    than async (is it?)
  • We need some ack channel, like in Fig. 1.17
  • (? extended Rebeca)

12
A Fair Server
  • There is a single process, server S, that is
    expected to provide services to N customer
    processes, called P1, , PN.
  • The server can serve only one customer at a time.
  • A fair server using shared variables, Fig. 1.20
    p.84
  • A fair server using message passing, Fig. 1.21
    p.85
  • It is different from 1.20

13
1.11 Model 4 Petri Nets
  • ?S??Fµ??????????????
Write a Comment
User Comments (0)
About PowerShow.com