Ignore:
Timestamp:
Apr 4, 2023, 9:50:07 AM (16 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
59c05958
Parents:
e8b1f23c
Message:

removed code style and refactored to use cfa code style

File:
1 edited

Legend:

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

    re8b1f23c r9363b1b  
    118118Also note that in the Go version~\ref{l:go_chan_bar}, the size of the barrier channels has to be larger than in the \CFA version to ensure that the main thread does not block when attempting to clear the barrier.
    119119
    120 \begin{cfacode}[tabsize=3,caption={\CFA channel barrier termination},label={l:cfa_chan_bar}]
     120\begin{cfa}[tabsize=3,caption={\CFA channel barrier termination},label={l:cfa_chan_bar}]
    121121struct barrier {
    122122    channel( int ) barWait;
     
    171171    return 0;
    172172}
    173 \end{cfacode}
    174 
    175 \begin{cfacode}[tabsize=3,caption={Go channel barrier termination},label={l:go_chan_bar}]
     173\end{cfa}
     174
     175\begin{cfa}[tabsize=3,caption={Go channel barrier termination},label={l:go_chan_bar}]
    176176
    177177struct barrier {
     
    237237    return 0;
    238238}
    239 \end{cfacode}
     239\end{cfa}
    240240
    241241In Listing~\ref{l:cfa_resume} an example of channel closing with resumption is used.
     
    244244If the same program was implemented in Go it would require explicit synchronization with both producers and consumers by some mechanism outside the channel to ensure that all elements were removed before task termination.
    245245
    246 \begin{cfacode}[tabsize=3,caption={\CFA channel resumption usage},label={l:cfa_resume}]
     246\begin{cfa}[tabsize=3,caption={\CFA channel resumption usage},label={l:cfa_resume}]
    247247channel( int ) chan{ 128 };
    248248
     
    280280    return 0;
    281281}
    282 \end{cfacode}
     282\end{cfa}
    283283
    284284\section{Performance}
Note: See TracChangeset for help on using the changeset viewer.