{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

The sequence of messages output by p and input by q

Info iconThis preview shows pages 16–21. Sign up to view the full content.

View Full Document Right Arrow Icon
the sequence of messages output by P and input by Q on this internal channel is concealed from their common environment. The result of the connection is denoted P >> Q (3) constraints: α ( P >> Q ) = αleft ( P ) αright ( Q ) αright ( P ) = αleft ( Q ) 16
Background image of page 16

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
$ % 2. Examples: X1 A pipe which outputs each input value multiplied by four (4.2 X2) QUADRUPLE = DOUBLE >> DOUBLE X2 A process which inputs cards of eighty characters and outputs their text, tightly packed into lines of 125 characters each (4.2 X3, X4) UNPACK >> PACK X3 Same as X2, except that each pair of consecutive asterisks is replaced by ” ” (4.2 X5) UNPACK >> SQUASH >> PACK X4 Same as X2, except that the reading of cards may continue when the printer is held up, and the printing can continue when the card reader is held up (4.2 X9) UNPACK >> BUFFER >> PACK 17
Background image of page 17
$ % X5 In order to avoid undesirable expansion of buffers, it is usual to limit the number of messages buffered. Even the single buffer provided by the COPY process (4.2 X1) may be adequate. Here is a version of X4 which reads one card ahead on input and buffers one line on output COPY >> UNPACK >> PACK >> COPY X6 A double buffer, which accepts up to two messages before requiring output of the first COPY >> COPY Its behaviour is similar to that of CHAIN 2 (2.6 X4) and VMS2 (1.1.3 X6). 18
Background image of page 18

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
$ % 3. Laws L1 P >> ( Q >> R ) = ( P >> Q ) >> R L2 ( right ! v P ) >> ( left ? y Q ( y )) = P >> Q ( v ) L3 ( right ! v P ) >> ( right ! w Q ) = right ! w (( right ! v P ) >> Q ) L4 ( left ? x P ( x )) >> ( left ? y Q ( y )) = left ? x ( P ( x ) >> ( left ? y Q ( y ))) Note: There are several other similar laws. Please see page 134-135. 19
Background image of page 19
$ % 4. Livelock (a) Bad cases (Divergent behavious): Let P = ( right !1 P ) Q = ( left ? x Q ) ( P >> Q ) is obviously a useless process; it is even worse than STOP , in that like an endless loop it may consume unbounded computing resources without achieving anything. Another example: Let P = ( right !1 P | left ? x P 1( x )) Q = ( left ? x Q | right !1 Q 1) In this example, divergence derives from the mere possibility of infinite internal communication. 20
Background image of page 20

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
$ % (b) avoiding livelock: A simple method to prove ( P >> Q ) is free of livelock is to show that P is left-guarded in the sense that it can never output an infinite series of messages to the right without interspersing inputs from the left. P is left-guarded ≡ ∃ f P sat (# right f ( left )) Properties: L1 If every recursion used in the definition of P is guarded by an input from the left, then P is left-guarded. L2 If P is left-guarded then ( P >> Q ) is free of livelock. L3 If Q is right-guarded then ( P >> Q ) is free of livelock. 21
Background image of page 21
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page16 / 21

the sequence of messages output by P and input by Q on this...

This preview shows document pages 16 - 21. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online