Changeset ac5d22f


Ignore:
Timestamp:
Jun 1, 2023, 11:58:05 AM (11 months ago)
Author:
caparsons <caparson@…>
Branches:
ast-experimental, master
Children:
0aef549
Parents:
22f2b7d
Message:

commit before pull to resolve merge conflicts

File:
1 edited

Legend:

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

    r22f2b7d rac5d22f  
    1919It was the popularity of Go channels that lead to their implemention in \CFA.
    2020Neither Go nor \CFA channels have the restrictions of the early channel-based concurrent systems.
     21
     22Other popular languages and libraries that provide channels include C++ Boost~\cite{boost:channel}, Rust~\cite{rust:channel}, Haskell~\cite{haskell:channel}, and OCaml~\cite{ocaml:channel}.
     23Boost channels only support asynchronous (non-blocking) operations, and Rust channels are limited to only having one consumer per channel.
     24Haskell channels are unbounded in size, and OCaml channels are zero-size.
     25These restrictions in Haskell and OCaml are likely due to their functional approach, which results in them both using a list as the underlying data structure for their channel.
     26These languages and libraries are not discussed further, as their channel implementation is not comparable to the bounded-buffer style channels present in Go and \CFA.
    2127
    2228\section{Producer-Consumer Problem}
     
    130136\paragraph{Go channels} provide a set of tools to help with concurrent shutdown~\cite{go:chan}.
    131137Channels in Go have a @close@ operation and a \Go{select} statement that both can be used to help threads terminate.
    132 The \Go{select} statement is discussed in \ref{s:waituntil}, where \CFA's @waituntil@ statement is compared with the Go \Go{select} statement.
     138The \Go{select} statement is discussed in Chapter~\ref{s:waituntil}, where \CFA's @waituntil@ statement is compared with the Go \Go{select} statement.
    133139
    134140The @close@ operation on a channel in Go changes the state of the channel.
     
    247253\begin{cfa}[aboveskip=0pt,belowskip=0pt]
    248254var cons_done, prod_done bool = false, false;
    249 var prodJoin chan int = make(chan int, Producers)
    250 var consJoin chan int = make(chan int, Consumers)
     255var prodJoin chan int = make(chan int)
     256var consJoin chan int = make(chan int)
    251257
    252258func consumer( channel chan uint64 ) {
Note: See TracChangeset for help on using the changeset viewer.