Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionBoth sides next revision | ||
alvis:sbrexample [2013/12/31 10:03] marcin created | alvis:sbrexample [2021/09/23 08:51] (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Example: Sender-Buffer-Receiver system ====== | ====== Example: Sender-Buffer-Receiver system ====== | ||
+ | |||
+ | Agent //S// (sender) puts sequentially valueless signals to the buffer (agent //B//) and agent //R// (receiver) gets such signals from the buffer. Agent //B// offers two procedures (services, ports) to connected agents. | ||
{{ : | {{ : | ||
< | < | ||
- | agent Sender | + | agent S { |
- | loop { | + | loop { -- 1 |
- | out put; | + | out put; -- 2 |
} | } | ||
} | } | ||
- | agent Buffer | + | agent B { |
i :: Int = 0; | i :: Int = 0; | ||
proc (i == 0) put { | proc (i == 0) put { | ||
in put; -- 1 | in put; -- 1 | ||
i = 1; -- 2 | i = 1; -- 2 | ||
+ | exit; -- 3 | ||
} | } | ||
proc (i /= 0) get { | proc (i /= 0) get { | ||
- | out get; | + | out get; |
- | i = 0; | + | i = 0; |
+ | exit; -- 6 | ||
} | } | ||
} | } | ||
- | agent Receiver | + | agent R { |
loop { -- 1 | loop { -- 1 | ||
in get; -- 2 | in get; -- 2 | ||
Line 30: | Line 34: | ||
- | **FIXME** | + | {{ : |
- | **[[: |