Ignore:
Timestamp:
Aug 1, 2023, 10:40:11 PM (10 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
d54ede6
Parents:
210c737
Message:

fixed bad page break and made figure location better

File:
1 edited

Legend:

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

    r210c737 r2cb15b0  
    313313Note, the expression inside a @waituntil@ clause is evaluated once at the start of the @waituntil@ algorithm.
    314314
     315\section{Waituntil Semantics}
     316
     317The @waituntil@ semantics has two parts: the semantics of the statement itself, \ie @and@, @or@, @when@ guards, and @else@ semantics, and the semantics of how the @waituntil@ interacts with types like locks, channels, and futures.
     318
     319\subsection{Statement Semantics}
     320
     321The @or@ semantics are the most straightforward and nearly match those laid out in the ALT statement from Occam.
     322The clauses have an exclusive-or relationship where the first available one is run and only one clause is run.
     323\CFA's @or@ semantics differ from ALT semantics: instead of randomly picking a clause when multiple are available, the first clause in the @waituntil@ that is available is executed.
     324For example, in the following example, if @foo@ and @bar@ are both available, @foo@ is always selected since it comes first in the order of @waituntil@ clauses.
     325\begin{cfa}
     326future(int) bar, foo;
     327waituntil( foo ) { ... } or waituntil( bar ) { ... } // prioritize foo
     328\end{cfa}
     329The reason for these semantics is that prioritizing resources can be useful in certain problems, such as shutdown.
     330In the rare case where there is a starvation problem with the ordering, it possible to follow a @waituntil@ with its reverse form, alternating which resource has the highest priority:
     331\begin{cfa}
     332waituntil( foo ) { ... } or waituntil( bar ) { ... } // prioritize foo
     333waituntil( bar ) { ... } or waituntil( foo ) { ... } // prioritize bar
     334\end{cfa}
     335While this approach is not general for many resources, it handles many basic cases.
     336
    315337\begin{figure}
    316338\begin{cfa}
     
    329351\label{f:wu_example}
    330352\end{figure}
    331 
    332 \section{Waituntil Semantics}
    333 
    334 The @waituntil@ semantics has two parts: the semantics of the statement itself, \ie @and@, @or@, @when@ guards, and @else@ semantics, and the semantics of how the @waituntil@ interacts with types like locks, channels, and futures.
    335 
    336 \subsection{Statement Semantics}
    337 
    338 The @or@ semantics are the most straightforward and nearly match those laid out in the ALT statement from Occam.
    339 The clauses have an exclusive-or relationship where the first available one is run and only one clause is run.
    340 \CFA's @or@ semantics differ from ALT semantics: instead of randomly picking a clause when multiple are available, the first clause in the @waituntil@ that is available is executed.
    341 For example, in the following example, if @foo@ and @bar@ are both available, @foo@ is always selected since it comes first in the order of @waituntil@ clauses.
    342 \begin{cfa}
    343 future(int) bar, foo;
    344 waituntil( foo ) { ... } or waituntil( bar ) { ... } // prioritize foo
    345 \end{cfa}
    346 The reason for this semantics is that prioritizing resources can be useful in certain problems, such as shutdown.
    347 In the rare case where there is a starvation problem with the ordering, it possible to follow a @waituntil@ with its reverse form, alternating which resource has the highest priority:
    348 \begin{cfa}
    349 waituntil( foo ) { ... } or waituntil( bar ) { ... } // prioritize foo
    350 waituntil( bar ) { ... } or waituntil( foo ) { ... } // prioritize bar
    351 \end{cfa}
    352 While this approach is not general for many resources, it handles many basic cases.
    353353
    354354The \CFA @and@ semantics match the @and@ semantics of \uC \lstinline[language=uC++]{_Select}.
Note: See TracChangeset for help on using the changeset viewer.