Changeset 2d831a1 for doc/theses/colby_parsons_MMAth/text/channels.tex
- Timestamp:
- May 8, 2023, 4:53:10 PM (16 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 84018e0
- Parents:
- c0527f8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/colby_parsons_MMAth/text/channels.tex
rc0527f8 r2d831a1 13 13 Both languages are highly restrictive. 14 14 Kahn's language restricts a reading process to only wait for data on a single channel at a time and different writing processes cannot send data on the same channel. 15 Hoare's language restricts ... 15 Hoare's language restricts channels such that both the sender and receiver need to explicitly name the process that is destination of a channel send or the source of a channel receive. 16 These channel semantics remove the ability to have an anonymous sender or receiver and additionally all channel operations in CSP are synchronous (no buffering). 16 17 Channels as a programming language feature has been popularized in recent years by the language Go, which encourages the use of channels as its fundamental concurrent feature. 17 Go's restrictions are ... 18 Go's restrictions are ... \CAP{The only restrictions in Go but not CFA that I can think of are the closing semantics and the functionality of select vs. waituntil. Is that worth mentioning here or should it be discussed later?} 18 19 \CFA channels do not have these restrictions. 19 20 … … 23 24 In the problem, threads interact with a buffer in two ways: producing threads insert values into the buffer and consuming threads remove values from the buffer. 24 25 In general, a buffer needs protection to ensure a producer only inserts into a non-full buffer and a consumer only removes from a non-empty buffer (synchronization). 25 As well, a buffer needs protection at each end resultingfrom concurrent access by multiple producers or consumers attempt to insert or remove simultaneously (MX).26 As well, a buffer needs protection from concurrent access by multiple producers or consumers attempt to insert or remove simultaneously (MX). 26 27 27 28 Channels come in three flavours of buffers: … … 34 35 Infinite sized (unbounded) implies the communication is asynchronous, \ie the producer never waits but the consumer waits when the buffer is empty. 35 36 Since memory is finite, all unbounded buffers are ultimately bounded; 36 this restrict must be part of its implementation.37 this restriction must be part of its implementation. 37 38 \end{enumerate} 38 39 … … 43 44 44 45 \section{First-Come First-Served} 45 As pointed out, a bounded buffer requires MX among multiple producers or consumers at either end of the buffer.46 As pointed out, a bounded buffer requires MX among multiple producers or consumers. 46 47 This MX should be fair among threads, independent of the FIFO buffer being fair among values. 47 48 Fairness among threads is called \gls{fcfs} and was defined by Lamport~\cite[p.~454]{Lamport74}. … … 64 65 65 66 \PAB{Discuss the Go channel implementation. Need to tie in FIFO buffer and FCFS locking.} 67 66 68 In this work, all channels are implemented with bounded buffers, so there is no zero-sized buffering. 69 \CAP{I do have zero size channels implemented, however I don't focus on them since I think they are uninteresting as they are just a thin layer over binary semaphores. Should I mention that I support it but omit discussion or just leave it out?} 67 70 68 71 \section{Safety and Productivity}
Note: See TracChangeset
for help on using the changeset viewer.