Changeset 9363b1b for doc/theses/colby_parsons_MMAth/text/channels.tex
- Timestamp:
- Apr 4, 2023, 9:50:07 AM (16 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 59c05958
- Parents:
- e8b1f23c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/channels.tex
re8b1f23c r9363b1b 118 118 Also 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. 119 119 120 \begin{cfa code}[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}] 121 121 struct barrier { 122 122 channel( int ) barWait; … … 171 171 return 0; 172 172 } 173 \end{cfa code}174 175 \begin{cfa code}[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}] 176 176 177 177 struct barrier { … … 237 237 return 0; 238 238 } 239 \end{cfa code}239 \end{cfa} 240 240 241 241 In Listing~\ref{l:cfa_resume} an example of channel closing with resumption is used. … … 244 244 If 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. 245 245 246 \begin{cfa code}[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}] 247 247 channel( int ) chan{ 128 }; 248 248 … … 280 280 return 0; 281 281 } 282 \end{cfa code}282 \end{cfa} 283 283 284 284 \section{Performance}
Note: See TracChangeset
for help on using the changeset viewer.