Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/colby_parsons_MMAth/text/waituntil.tex

    raae9c17 r9509d67a  
    168168Go'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.
    169169However, 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}.
     170As such, the exponential blowup can be seen comparing Go and \uC in Figure~\ref{f:AdaMultiplexing}.
    171171Go also provides a timeout via a channel and a @default@ clause like Ada @else@ for asynchronous multiplexing.
    172172
     
    519519In 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.
    520520\begin{cfa}[deletekeywords={timeout}]
    521 waituntil( i << C1 ); and waituntil( timeout( 1`s ) );
    522 or waituntil( i << C2 ); and waituntil( timeout( 3`s ) );
     521waituntil( i << C1 ){} and waituntil( timeout( 1`s ) ){}
     522or waituntil( i << C2 ){} and waituntil( timeout( 3`s ) ){}
    523523\end{cfa}
    524524If only @C2@ is satisfied, \emph{both} timeout code-blocks trigger because 1 second occurs before 3 seconds.
     
    542542Now the unblocked WUT is guaranteed to have a satisfied resource and its code block can safely executed.
    543543The 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.
     544Note that all channel operations are fair and no preference is given between @waituntil@ and direct channel operations when unblocking.
    544545
    545546Furthermore, 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.