- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/waituntil.tex
raae9c17 r9509d67a 168 168 Go's @select@ has the same exclusive-or semantics as the ALT primitive from Occam and associated code blocks for each clause like ALT and Ada. 169 169 However, unlike Ada and ALT, Go does not provide guards for the \lstinline[language=go]{case} clauses of the \lstinline[language=go]{select}. 170 As such, the exponential blowup can be seen comparing Go and \uC in Figure~\ label{f:AdaMultiplexing}.170 As such, the exponential blowup can be seen comparing Go and \uC in Figure~\ref{f:AdaMultiplexing}. 171 171 Go also provides a timeout via a channel and a @default@ clause like Ada @else@ for asynchronous multiplexing. 172 172 … … 519 519 In following example, either channel @C1@ or @C2@ must be satisfied but nothing can be done for at least 1 or 3 seconds after the channel read, respectively. 520 520 \begin{cfa}[deletekeywords={timeout}] 521 waituntil( i << C1 ) ; and waituntil( timeout( 1`s ) );522 or waituntil( i << C2 ) ; and waituntil( timeout( 3`s ) );521 waituntil( i << C1 ){} and waituntil( timeout( 1`s ) ){} 522 or waituntil( i << C2 ){} and waituntil( timeout( 3`s ) ){} 523 523 \end{cfa} 524 524 If only @C2@ is satisfied, \emph{both} timeout code-blocks trigger because 1 second occurs before 3 seconds. … … 542 542 Now the unblocked WUT is guaranteed to have a satisfied resource and its code block can safely executed. 543 543 The insertion circumvents the channel buffer via the wait-morphing in the \CFA channel implementation \see{Section~\ref{s:chan_impl}}, allowing @waituntil@ channel unblocking to not be special-cased. 544 Note that all channel operations are fair and no preference is given between @waituntil@ and direct channel operations when unblocking. 544 545 545 546 Furthermore, if both @and@ and @or@ operators are used, the @or@ operations stop behaving like exclusive-or due to the race among channel operations, \eg:
Note: See TracChangeset
for help on using the changeset viewer.