1. The RC 4000 nucleus, Copenhagen, 1969
The story begins in Copenhagen, with the earliest message-based system of the session: a computer of 1967 whose multiprogramming system, finished in 1969, made messages the basic means of communication between its processes1. It predates Kahn's networks, CSP and the actor model.
The computer was Regnecentralen's RC 40001. Its first prototype monitored temperatures and pressures at an ammonia plant at Puławy in Poland, designed by the engineering firm Haldor Topsøe2. The prototype also counted how many kilos of fertilizer left the plant each day2. Politiken names the leader of the group building its multiprogramming system: Per Brinch Hansen, aged 302.
The nucleus the group built is the reason the machine is in the story. Brinch Hansen's team did not write a conventional operating system. They wrote a small nucleus with three jobs, in the paper's words: the simulation of processes, communication among processes, and the creation, control and removal of processes3. Messages were its basic means of communication between processes. Operating systems and user programs ran on top as ordinary processes; device handling and process control stayed inside the nucleus3. The paper appeared in Communications of the ACM in April 1970 as "The Nucleus of a Multiprogramming System"3. The nucleus was small, 4,800 words, or 6,200 with the basic operating system; a send took 0.6 ms, a wait 0.4 ms, a full conversation about 2 ms3. The RC 4000 was not widely used, and it is an early published microkernel design. The idea of a minimal kernel in which processes communicate only by messages is commonly read as the start of the microkernel line. The line's best-known later members are Mach (CMU, from 1985) and L4 (Liedtke, 1993 to 1995); no source opened draws the line from the nucleus to either by name.
The choice of messages was deliberate. Brinch Hansen had learned synchronization from Dijkstra's Cooperating Sequential Processes, the manuscript that made semaphores widely known4: Brinch Hansen's reference list dates the manuscript September 1965, and it was printed in 1968. The 1970 paper acknowledges it: "we have benefited greatly from Dijkstra's analysis of cooperating sequential processes"3. Having learned semaphores, he chose not to hand them to processes. He gave them messages instead, and the paper says why. The semaphore concept alone "does not fulfill our requirements of safety and efficiency in a dynamic environment in which some processes may turn out to be black sheep and break the rules of the game"3.
What a message buys against shared memory is the problem of the lecture. The machine returns first to show where its shared memory went (section 3), then to show that it uses two of the session's three resolutions at once (section 6). It returns again wherever a later system reuses one of its ideas.
4. Kahn process networks: determinism without choice
Once processes share nothing, timing can matter only where they meet, and the gain is sharpest where no meeting point is ever contested. Kahn's networks of 1974 are the case in which none is: they are deterministic by construction.
In 1974, Kahn described processes connected by FIFO channels8,10 (cited by Hoare 1978 as reference [12]). Each process is a sequential, deterministic program, whose outputs depend only on the values it has read; each channel has exactly one writer and, in the form this lecture keeps, one reader. A write never waits; the channel is an unbounded queue. A read names one channel and waits until a value is there. A process cannot ask "is there something on this channel?" and cannot wait on "whichever channel is ready first".
Kahn's own rule is weaker on the reading side: a channel has one writer, and several processes may read it, each receiving every value10,15. This lecture keeps one reader per channel and loses nothing by it. A channel read by several processes behaves as a process that reads the channel and writes each value to one channel per reader. That copying process is sequential and deterministic, so the network is still a Kahn network and computes the same histories. Run on Go channels at capacities 0, 1 and 100, two readers behind a copying process received all twelve values, in order, in every one of 400 runs at each capacity. Two readers taking from one channel instead shared the values out in 31 to 77 different ways at GOMAXPROCS 12, and in one way at GOMAXPROCS 1 (run: extra/0b/fanout_split.go). The copy is therefore not a split: in a split, several readers consume one channel and each value reaches one of them, which section 5 counts among the ways nondeterminism enters9. With bounded channels the copying process ties the readers' pace together, a reader that stops reading holding up the other; that changes the waiting and never the values (section 8, point 1).
Kahn's result is determinism: under any fair schedule, the network computes the same sequences on its channels8,9. The reason has two parts. First, because reads block and nothing tests for emptiness, each process computes a continuous, hence monotone, function of its input histories8,9. Such a function is what Kahn's fixed-point argument needs, and sequential processes with blocking reads compute one8,9. Second, no two processes ever compete for the same communication. So under any fair schedule, one in which every process that can run eventually does, the network computes the same sequences; an unfair schedule computes a prefix of them. Timing can change when things happen but never what happens. Drop either part and determinism is no longer guaranteed; section 5 lists the ways it can go. An assembly line is the picture: each station takes from the belt before it and puts on the belt after it. However fast or slow each worker is, the parts come out in the same order with the same work done.
Two senders and one receiver, with and without a contest
The difference between a contested meeting point and an uncontested one fits in four lines of Go, first with competition. Two goroutines send to one channel, and the main goroutine prints what arrives:
hello_loop.go, the lines shownc := make(chan string)
go func() { c <- "hello" }()
go func() { c <- "world" }()
fmt.Println(<-c, <-c) // "hello world" or "world hello"
Same code, two possible outputs. The two senders compete for the receiver, and the scheduler settles it. In practice one order dominates. In 3,000 iterations with go1.27.1, "hello world" appeared 0 times at GOMAXPROCS 1, 10 times at 2 and 3 times at 12 (run: blocks/hello_loop.go). An earlier run had printed "world hello" 3,000 times out of 3,000 (go1.24.7, GOMAXPROCS 1 and 2). For the lecture, the program runs in a loop with GOMAXPROCS at least 2, and the outcomes are counted before both are shown. The reliable demonstration of two outcomes is a select whose two cases are both ready when it runs, for instance two channels of capacity 1 filled before it. The demonstration is reliable because the specification states that this choice is uniform and pseudo-random14. A select fed by two freshly started goroutines inherits the scheduler's bias, and the two-sender merge is the measured case, its bias the runtime's.
A second version follows Kahn's discipline, one writer, one reader and no choice, on Go channels. Each sender gets its own channel, and the receiver names which channel to read. Unlike Kahn's, these writes block; that can stop a network early, so its output can be cut short, but every value it does produce is the one the unbounded network produces.
a, b := make(chan string), make(chan string)
go func() { a <- "hello" }()
go func() { b <- "world" }()
fmt.Println(<-a, <-b) // always "hello world"
The output never changes. The price is visible too: if the "hello" goroutine is slow, main waits on a even though "world" is already waiting on b.
c := make(chan string)go func() { c <- "hello" }()go func() { c <- "world" }()fmt.Println(<-c, <-c)a := make(chan string)b := make(chan string)go func() { a <- "hello" }()go func() { b <- "world" }()fmt.Println(<-a, <-b)hello_loop.go, the one-channel program, go1.27.1, 3,000 runs each: "hello world" 0, 10 and 3 times at GOMAXPROCS 1, 2 and 12
Two senders and one receiver on an unbuffered channel, two runs side by side, each one possible schedule. A dot marks a goroutine reaching its send, a dotted stretch of a lane is that goroutine waiting, and a horizontal arrow is a handshake, sender and receiver meeting at one instant. With one channel the runs print different things; with one channel per sender they wait differently and print the same.
- The program: two goroutines send on one channel c, and main receives twice.
- One run: world is received first and printed first; sender 1 waits until main receives again. This is the order nearly every run shows.
- Another run: hello first, and the output changes. With go1.27.1 at GOMAXPROCS 2 it happened 10 times in 3,000; the specification leaves the order among senders open.
- One channel per sender, main reading a then b: in one run main waits on a (in orange) while world already waits on b; in the other, world waits. The waiting differs, the output never does.
That is the whole trade-off of the session in one picture: a contested communication buys responsiveness and costs determinism; no contest keeps determinism and costs waiting. Here the contest is a merge, two writers on one channel. A guarded choice in the program is the other way to let a contest in, and section 5 names both. In the lab, part 1 runs this program on one queue under both disciplines.
The cost is a possibility, not a necessity: a program may use a choice whose branches lead to the same result. The result then stays deterministic, in the sense of the same observable results, although the execution is not. Equally, a network without choice waits needlessly only where the channel it reads is empty while another is not.
Kahn networks are not exotic. A plain shell pipeline, grep x | sort | uniq, is one. Each program is a deterministic program that reads one input and writes one output. For the same input in the same environment, it therefore gives the same answer every time. Its pipes are bounded buffers, unlike Kahn's unbounded queues, so a network of pipes can stall where Kahn's cannot. It can stall on a cycle, on paths that fork and rejoin, or where a live reader stops reading before its writer stops writing. A straight pipeline that drains only waits. A reader that exits instead ends its writer, whose next write fails with EPIPE and raises SIGPIPE16. Either way the pipeline never prints something different (section 8). The command lines below show each case on the lecture machine. Unix pipes are documented in the Third Edition manual of February 1973, whose page pipe(II) is dated 15 January 197317, and Ritchie dates the implementation to 197218.
The idea is older than the system call. McIlroy's memo of 11 October 1964 asks for "some ways of coupling programs like garden hose"19. Conway's coroutines of 1963 already chained the stages of a compiler inside one program, each module "an autonomous program which communicates with adjacent modules as if they were input or output subroutines"20. Pipes thus ran before Kahn gave networks of this shape a theory in 1974. Kahn's paper cites neither Unix nor Conway8; Kahn and MacQueen's report of 1976 cites both, the Unix "pipelining combinator" and "Conway's original concept of coroutines"15. The time-sharing systems and the networks of machines that led towards the story without belonging to its theory are in appendix J.
Choice among inputs arrived in Unix later, with the select system call, distributed in 4.1cBSD in April 1983 and released with 4.2BSD in August 198321,22,23. The call came as part of the interprocess communication Berkeley built for networks; the sockets of that interprocess communication replaced the multiplexed files of Version 724. select reports which descriptors are ready, and the program then performs the read25; a guard of CSP performs the communication it waits for (section 7). A network of the same kind in Go is the prime sieve, a pipeline of goroutines with one filter per prime:
func generate(out chan<- int) {
for i := 2; ; i++ {
out <- i
}
}
func filter(in <-chan int, out chan<- int, p int) {
for {
n := <-in
if n%p != 0 {
out <- n
}
}
}
func main() {
ch := make(chan int)
go generate(ch)
for i := 0; i < 10; i++ {
p := <-ch
fmt.Println(p)
next := make(chan int)
go filter(ch, next, p)
ch = next
}
}
Every channel has one writer and, at any moment, one reader: main takes one value from ch and only then starts the filter that reads it next. The two readers are therefore ordered by the program text and never concurrent. With one writer and one reader per channel at any moment, the printed primes never change order whatever the scheduling. The stages wait on each other, which is the price named above.
Unix pipelines as Kahn networks on the lecture machine
Eight command lines, run on the lecture machine, show the model at work and where pipes depart from it.
seq 1 100000 | grep 7 | sort -r | head -5
seq 5 | while read x; do sleep 0.$RANDOM; echo $x; done | awk '{print $1*$1}'
printf 'b\nZ\na\nB\nA\n' | LC_ALL=C sort
printf 'b\nZ\na\nB\nA\n' | LC_ALL=en_US.UTF-8 sort
(dd if=/dev/zero bs=1k count=200 2>/dev/null; echo 'writer done' >&2) | (sleep 3; wc -c)
yes | head -3
rm -f f; mkfifo f; seq 1 200000 | tee f | paste - <(tail -r f)
{ (sleep 0.0$RANDOM; echo hello) & (sleep 0.0$RANDOM; echo world) & wait; } | cat
- The first printed the same five lines in 53 runs.
- The second took between 1.35 and 2.38 seconds and printed
1 4 9 16 25every time: a slow stage changes when, not what. - The third and the fourth sorted the same five lines in two orders,
A B Z a banda A b B Z: the environment is an input. - The fifth shows that a pipe is bounded. The pipe holds 65,536 bytes on this machine, so the writer of 200 KiB finishes only after the reader wakes, at 3.02 seconds; a writer of 64 KiB finishes at once.
- The sixth prints three lines;
yesthen ends, killed bySIGPIPE16, and the shell reports status 141 (run). The reader stopped early, which cut the output short and changed none of it. - The seventh is a fork that rejoins:
teewrites every line topasteand to the named pipef, andtail -r(tacon GNU systems) writes nothing before its input ends. With 10 lines it completes; with 200,000 it stalls:teewaits forpasteto take more,pastewaits for its first line fromtail, andtailwaits for the end off, whichteeholds open. It completed in every try up to 73,728 bytes of input and stalled in every try from 108,894 bytes, and in some tries between. An unbounded network would finish. - The last puts two writers on one pipe, without any
select: in 20 runs, 14 printedhello worldand 6world hello. It is a merge, several writers on one channel, the first way out of Kahn's conditions that section 5 names.
The runs are on record under demos/extra/0b/ (pipelines.sh, pipe_capacity.py, pipe_fill.sh, fork_rejoin.sh, each with its .run.txt).
The limits of a deterministic network
The absence of choice costs something besides waiting. A deterministic network cannot:
- serve whichever client asks first;
- give up after a timeout;
- react to whichever of two events happens first.
Are these limits missing features, or the cost of determinism? Each of the three is a decision that depends on timing, and a Kahn process cannot take one. To read, a process names one channel and waits until a value is there. It "cannot be waiting on data coming from one or another of its input lines"8, and the availability of a value "cannot be tested"15. A server with two clients must therefore name one client's channel. If that client is silent, the server waits, as main waits on a in the hello world above, although the other client has already asked. The order of service is fixed by the program text and the values read, never by who asked first. A timeout means that nothing arrived by a time t, and observing that nothing arrived is the test for emptiness the model forbids9. A process that reads a clock and sends the time on a channel does not help, because the reading process still names the channel it reads next by its program text and the values it has read, never by what has arrived. Reacting to whichever of two events happens first is the waiting form of the same test. A network can act on a timeout or an arbitration only when some process supplies it as a value on a channel. That process, which reads a clock or merges two inputs, is then the source of nondeterminism itself (section 5).
The reason underneath lies in what a process may depend on. Its outputs are a function of the histories of its inputs, the sequences of values on its channels8. A history records the values and their order, not the times at which they arrived. Kahn and MacQueen excluded "time-dependent input/output behaviour" on purpose15. Which of two channels received a value first is in no history, so no decision can be written on it. The three limits are therefore not missing features; they are what determinism costs. A merge that takes from whichever input has a value is accordingly not a Kahn process: a nondeterminate merge "must be either unfair or nonmonotonic, and hence not continuous"9.
Real systems need all three, so competition has to be let back in. Kahn's network is the reference point of what follows: each system the rest of the lecture reads is described by the conditions of Kahn's that it gives up, and by what it gains for them. The whole session turns on how a contested communication is resolved.
5. Contested communications: where nondeterminism enters, and three resolutions
A communication is contested when more than one party may be taken next at the same point. Where the program text does not decide which party is taken next, something other than the text decides it: the language's selection among the ready partners, the scheduler, the runtime, or the order of arrival. The systems of this story resolve a contested communication in one of three ways. The list classifies them and is not exhaustive (a split, several receivers on one Go channel, is resolved by the runtime's queue of waiting receivers, which the specification leaves open):
- No contest. One writer and one reader per channel, and no choice: Kahn's network. The result is deterministic, and the price is waiting.
- A guarded choice in the program. The program marks a point where it takes whichever of several partners is ready, and the language selects among those ready there: Hoare's guarded commands and Go's
select. This is the channel family. Section 7 compares Kahn's networks with CSP, which has this construct. - Arrival order in a queue. Many senders put messages into one queue, and the order of arrival determines which is served first: the RC 4000's queues, actors, Erlang. This is the mailbox family. The order of arrival is the free variable. The actor model leaves it arbitrary, and Erlang fixes it per pair of sender and receiver. An Erlang receiver may then select among the arrived messages by pattern.
The kitchen of section 2 shows the three. With no contest, the cook at the pass takes plates from the hatches in an order fixed by the recipe: the next plate is never in doubt. If the next hatch is empty, the cook waits, although another hatch already holds a plate. With a guarded choice, the cook watches two hatches and takes from whichever has a plate: the choice is made at one visible place. With arrival order, the tickets pinned on a cook's spike are cooked in the order they were pinned (section 9), and which ticket was pinned first depends on when the waiters came.
Each later section says which resolution its systems use, and the one machine of 1969 turns out to use two of them at once by default.
Two senders, P and Q, and one receiver, R, drawn three times on one scaffold; the drawings differ in one element, the one that resolves a contest for R, and the steps send the same two messages through each, q sent first. The three classify the systems of this session; they are not a taxonomy of message passing.
- P and Q each have a message for R; q is sent first.
- No contest: one channel per sender, and R reads a, then b. q, sent first, waits on b; there is one outcome, p then q, at the price of that wait.
- A guarded choice: R takes a partner that is ready. Here q is ready first and is taken; in a run where both are ready, Go takes one by a uniform pseudo-random selection, so p can come first: two outcomes.
- Arrival order: both messages go into R's queue, and R takes them from the front. q arrived first and is served first; another run can bring p first: two outcomes.
In a program whose processes share nothing by any other route, whose messages carry values and whose runtime delivers them as section 11 assumes, nondeterminism can enter only where several parties compete for one communication point, where a process tests whether a communication is possible, or inside a process. A contest allows a different outcome and does not force one. Lee and Parks list five ways to add nondeterminism to a Kahn network: testing inputs for emptiness, internally nondeterminate processes, several writers on a channel, several readers on a channel, and shared variables9. Message passing removes the shared variables. Of the remaining four, three are communication points (several writers, several readers, a test for emptiness), and one, a process that is nondeterminate inside itself (a clock, a random draw), no model removes. A language adds a fourth communication point, the guarded choice, a test of which input is ready. The four communication points:
- many senders into one receiver, a merge;
- many receivers on one channel, a split;
- a choice the programmer writes among alternatives, a guard that asks which input is ready;
- a test for emptiness, asking whether a message is there without waiting for it (Go's
selectwithdefaultorlenof a channel, Erlang'sreceive … after 0).
None of this is about receive versus send: two goroutines reading one Go channel compete as much as two writing to it. Kahn's network, in the course's form, rules out all four by giving every channel one writer and one reader and forbidding choice and tests for emptiness. The three resolutions are what each family makes its default, not the limits of what it can express. Go has merges, and Erlang's selective receive is a guarded choice over the messages already merged into the mailbox.
Beside the resolution of contested communications, a model has to settle five other things, each met once in what follows. They are what a send names (a process, a channel, a mailbox); whether the sender waits; which order is kept; whether a message can be lost; and what happens when a partner dies. The survey of Andrews and Schneider classifies models by the first two11. The last three concern a message after its send and a partner after its death. The last of them is exact on one node whose runtime tracks the death of its processes, as Erlang's and the RC 4000's do and Go's does not. Session 9 takes up the death of a partner in full.
6. The RC 4000 nucleus: two resolutions in one machine
With the three resolutions named, the machine of section 1 can be read properly.
The 1970 paper names four primitives3:
client: server:
buf := send message(server, m) loop
-- returns at once (sender, m, buf) := wait message()
...other work... ...serve m...
answer := wait answer(buf) send answer(buf, result)
One conversation runs as follows. The client calls send message, naming the server. Within its limit of outstanding messages, the call returns at once with the identity of the buffer used3 (what happens beyond the limit is not on record). The client goes on with other work3. The server waits in wait message until a message is in its queue, and receives the sender's name, the message and the buffer3. It serves the request and calls send answer, which copies the answer into the same buffer; the server continues at once3. The client calls wait answer on its buffer and waits until the answer is there; the buffer then goes back to the pool3. In the lab, the warm-up is a toy of this nucleus with these four names, the holes in send message and wait message, and that is where the primitives are first met in full.
Requests: a send names a process, which has one queue, and messages from every sender land in it in arrival order3. The primitive wait message serves them first come, first served, and two further primitives let a process serve its queue in any order3. Within its limit of outstanding messages, the sender does not wait. When several clients compete for one server, arrival order in the queue resolves the contest through wait message. This is the mailbox family's resolution, four years before Hewitt's actors.
Replies: the answer travels back in the same buffer, delivered into the client's queue, and the client waits for that buffer by its identity3. The paper calls the choice of a buffer "the creation of an identification of a conversation"3. The nucleus stores the identity of sender and receiver in each buffer and checks it whenever a process sends or waits for an answer in that buffer. In this way, no third process can interfere with a conversation3. Nobody competes for a reply, because the client waits for one identified item and not for the next thing in its queue. Here the no-contest resolution of section 5 is obtained by identifying the conversation rather than by wiring one channel to one reader. The same idea returns as Go's reply channel carried in the request (section 7) and as Erlang's reference matched by a selective receive (section 9). One difference remains: the nucleus checks the identity, where Go's and Erlang's programs keep it by convention. In the kitchen, a request is a ticket on the spike, cooked in the order pinned. The reply is the plate marked with the table's number: the waiter waits for that plate, not for the next one that comes out.
-- client Cbuf := send message(S, m) ...other work...answer := wait answer(buf) -- server S, in a loop(sender, m, buf) := wait message()send answer(buf, result)One conversation on the RC 4000, on the same section, and the two resolutions of one machine: requests meet in the server's queue and are served in arrival order; the answer comes back in the same buffer, b7, into the client's queue, where the client takes it by its identity, so nobody competes for the reply. Buffers stay in the nucleus; only copies cross the floor.
- Process D has already sent d to the server; the buffer holding d waits at the head of S's queue.
- C sends m to S: the nucleus takes buffer b7 from the pool and links it behind d; C continues at once, holding b7's identity.
- While C does other work, D sends x to C: another buffer lands in C's queue.
- C calls wait answer(b7) before the answer exists: C waits.
- S calls wait message, first come, first served: d first, and a copy of d goes into S's memory (S's answer to D is not drawn).
- Then b7: a copy of m goes into S's memory, and b7 stays in the nucleus, held for the answer. Arrival order has settled the contest between D and C.
- S sends its answer: the nucleus puts it in the same buffer, now b7 · r, which joins C's queue behind x, an unrelated message.
- C's wait answer(b7) takes b7 past x, by its identity, which the nucleus checks: a copy of the answer goes into C's memory. Nobody competed for the reply.
- The conversation is over: b7 goes back to the pool.
The pool of buffers is finite, with "a limit is set to the number of messages a process can send simultaneously"3. A send to a process that does not exist gets "a dummy answer generated by the system nucleus"3. The nucleus can give such an answer because it sees every process, and section 11 returns to it. Kahn's paper of 1974 names this nucleus among the systems showing that its own primitives, wait and send, "are not too far from reality"8,3. The claim is about the primitives, not the network, since wait message merges every sender into one queue, the mailbox family's resolution. The full account of the nucleus, with the two further primitives and where its design places the risk of a conversation, is in appendix A.
The machine thus splits each conversation in two and resolves the halves differently: requests, from many senders, by their order of arrival; replies, each identified, by no contest at all.
7. Channels: synchronous communication and guarded choice (CSP, occam, Go)
In the RC 4000, only the replies travelled uncontested, by identification. The channel family builds a whole language from meetings of named parties: Hoare's CSP of 1978, its channel form of 1985, occam and Go.
A guarded choice in the program is the place where the programmer marks a contest for the language to resolve. A merge on a channel is left to the scheduler.
Hoare, 1978: communication as a primitive
Hoare's paper proposes input and output as basic primitives of programming, and parallel composition of communicating sequential processes as a fundamental way to structure programs10. Four of its choices define the language as this story reads it10:
- No shared variables. Processes in a parallel command are disjoint10.
- Named partners. An input names its source process and an output its destination.
X?(x, y)in one process andDIV!(3*a+b, 13)in the other together act as the assignment(x, y) := (3*a+b, 13)10. - No buffering. "There is no automatic buffering"10. Whichever side is ready first waits, and "Such delay is invisible to the delayed process"10. The two commands execute simultaneously.
- Partner termination. An input fails if its source has terminated, and an output fails if its destination has10.
The list also fixes what the language lacks: there is no connection and no channel object. Each exchange is a single event between two named processes, and nothing persists after it. To send again, the programmer writes another output command, which must meet another input. The only lasting structure is in the program text. The parallel command fixes the set of processes10. Each command names the process it addresses, and that name may carry a subscript computed at run time10.
The picture for the handshake is a phone call: both parties must be on the line at the same moment, and nothing is said until both are. A buffered send is a letter: it is posted and the sender walks away.
Guarded choice
One construct makes this language more than a set of single meetings between named parties. A guard may end in an input command, and the guarded branch runs only if the named source is ready to output. When several are ready, exactly one is chosen, arbitrarily10.
*[ n < 10; producer?x → buffer(n) := x; n := n + 1
□ n > 0; consumer?more() → consumer!buffer(0); shift
]
This sketch of Hoare's bounded buffer shows the idea. The process offers two communications and takes whichever partner turns up. In the kitchen, it is a cook between the delivery door and the pass, who answers whichever bell rings: the door's while the shelf has room, the pass's while it holds stock. This is the guarded choice in the program: the programmer marks one visible point, the language selects among the partners ready there, and everything else stays deterministic.
Kahn's networks and CSP compared
Do Kahn's networks and CSP differ by their synchrony or by choice? They share three things: no shared memory, partners fixed by the program text, and a read that waits until a value arrives. The fixed partner is a channel's writer in Kahn's networks and the named process in CSP 1978, where no channel object exists. Hoare listed the differences himself10. Kahn's processes are "strictly deterministic: No choice is given between alternative sources of input". Their output is "automatically buffered to any required degree". It "can be automatically fanned out to any number of processes". They run forever, where CSP's parallel command "is normally intended to terminate". The 1985 book repeats the first three, determinism, buffering and fan-out26. Of these, only the first decides the values computed. By the rule of section 8, buffering decides waiting, deadlock and what the sender knows in a network without choice. A value copied to several readers is the same value for each. Termination ends a history without changing its values, unless a process acts on a partner's termination, which the conditions below exclude.
A CSP program therefore computes as a Kahn network whose channels hold nothing when it meets four conditions. Its processes are deterministic, and no alternative command has two guards that can succeed together, whether by an input or by boolean guards alone10. Every channel has one writer and one reader, and no process acts on a partner's termination, which in CSP 1978 makes an input fail10. It then produces no value the Kahn network would not produce, and it waits more. It can deadlock where the unbounded network runs on, as the cycle at the end of this section shows (run). With guarded choice the program leaves Kahn's conditions. What separates the two models in their results is choice, not synchrony. Hoare credited the buffered design with "an elegant theory which permits proof of the properties of programs"10.
Reasons for synchronous communication
From today's side, the unbuffered send can look odd. Four reasons are given for it, from different sources:
- Provability. A communication is one event shared by two processes. With a buffer there is a send event, a receive event, and hidden queue state between them. The algebra of CSP that followed (Hoare's 1985 book) is built on the shared event26; this is a later reading, not a reason given in 1978.
- No arbitrary buffer size. Hoare chose size zero and let programmers write buffers as processes, for two reasons: buffering is less realistic on separate processors, and it can be built from the primitives where needed. He also concedes the symmetric point, that synchronization could be built from buffered commands10.
- Knowledge. After a synchronous send, the sender knows the receiver has the value. It can make assertions about the receiver's state11.
- Backpressure. A fast producer cannot run ahead and fill memory. Any bounded buffer that blocks its sender when full, zero included, has this property. The property is therefore a reason for bounding rather than for size zero, and the 1978 paper does not give it.
From named partners to channels
In the CSP line, the handshake survived; the naming did not. CSP 1978 had a weakness, and Hoare discussed it himself10. Consider a buffer process B between a producer P and a consumer C. In 1978 style, B's code names its partners:
B :: *[ x: integer; P?x → C!x ]
To reuse B between two other processes, X and Y, the programmer must rewrite B. Hoare called port names "attractive" and judged them "semantically equivalent" for point-to-point connections10. With channels, B names its own two ends, and whoever assembles the system plugs real channels into them:
B(in, out) = in?x → out!x → B(in, out)
In this line the parameters in and out are the channels; the right-hand side is B's behavior, not a channel. Read in order:
in?x: receive a value on the first channel and name it x;out!x: send x on the second channel;- each arrow: "then".
A CSP channel is a name fixed in the program text and joined when the system is assembled: B(left, mid) ‖ B(mid, right) connects two buffers through the channel mid. A process's channels belong to its alphabet, which Hoare's book makes "a permanent predefined property of an object"26. In the book, a process's set of channels never changes at run time. A Go channel, by contrast, is a value (the reply channel below), and so is a name of the π-calculus (section 12). The book writes the buffer and the chain of two buffers as
COPY = µ X • (left?x → right!x → X)
COPY >> COPY
where P >> Q connects the right channel of P to the left channel of Q and conceals the messages on it26.
The handshake is unchanged. The only change is that a process names its own ends instead of its partners. Hoare's 1985 book writes communication over named channels26 and names occam among the languages built on them26. When people say "CSP" today, they usually mean this channel version, and that is what Go took up. The dates put the two ideas in an unexpected order. Buffered constructs came first: the RC 4000's finite pool in 19693 and Unix pipes in practice (1972, by Ritchie's account)18, Kahn's networks in theory (1974)8. Hoare described named ports joined by synchronous channels as an alternative in 197810, and CCS (1980) and occam (1983) made named synchronous channels the norm. Hoare's 1985 book uses channels as its notation for communication26.
Go: the rules as the specification states them
Go's specification states the rules of this family14:
- With capacity zero, a channel is unbuffered and "communication succeeds only when both a sender and receiver are ready". With capacity n, a send proceeds if the buffer is not full and a receive if it is not empty.
- A channel is a first-in-first-out queue: with one sender and one receiver, values are received in the order sent; the specification states no order among concurrent senders.
- A send on a closed channel panics; a send or receive on a
nilchannel blocks forever. - A
selectchooses among cases that can proceed by "a uniform pseudo-random selection". With none ready, it takesdefaultif there is one; otherwise it blocks.
Go's select allows send cases as well as receive cases. Hoare's 1978 language allowed only input guards10. That difference matters in section 12, where a choice that waits on a send and a receive at once is the problem.
Go's reply channel is the RC 4000's identified conversation with a channel as the identity. A request carries the channel on which its answer is to come back, and only the client reads it, by convention. The type chan<- int stops the server from reading it, and nothing stops another goroutine that holds it.
type req struct {
n int
reply chan<- int // the server may only send on it
}
func counter(reqs <-chan req) {
total := 0
for r := range reqs { // one request at a time
total += r.n
r.reply <- total // the answer goes back where the request said
}
}
// a client
reply := make(chan int)
reqs <- req{5, reply}
fmt.Println(<-reply)
A choice among several ready channels is easy to implement when one lock covers every channel, since the chooser inspects them all atomically and commits to one. Without a global lock, Go's runtime locks all of the select's channels in a fixed order, by address, before inspecting them, and commits to one case by an atomic operation13. A commit protocol between the two parties is another design, so that no partner is taken twice. The specification fixes what a select does, not how it locks14, and the one-lock version is the lab's teaching implementation. In the lab, the quest builds select on that one lock.
A timeout is one more branch of the choice, with the clock as an extra sender:
select {
case r := <-reply:
use(r)
case <-time.After(100 * time.Millisecond):
giveUp()
}
select {case r := <-reply: use(r)case <-time.After(100 * time.Millisecond): giveUp()}A select with a timeout as a small Petri net: a circle is a state, a bar is a communication, a dot is a token. A bar fires when its partner is ready and the goroutine's token is waiting; firing moves the token on and uses the partner's, so exactly one branch runs. Two runs stand side by side.
- The goroutine is blocked in select: neither the server nor the clock is ready.
- In one run the server is ready first: its bar fires, r crosses it, and the goroutine goes on into use(r).
- In another run the clock fires first: the timeout branch runs, giveUp().
- When both are ready as the select runs, it takes one case by a uniform pseudo-random selection, as the specification states: the two runs take different branches. In the run that takes the timeout, the server's send on the unbuffered reply channel stays blocked, since nothing receives it.
The server above sends every answer and serves one request at a time. With a timeout, its reply channel needs a slot. A client that gives up no longer receives, and the server's send on an unbuffered reply channel would then wait forever, holding up every later request. Creating each request's reply channel with make(chan int, 1) lets the late answer land in the slot14, where nothing reads it. The channel must be fresh for each request: a reused reply channel hands the late answer to the next request (run: "answer 5, expected 12", extra/s1/reply_combo.go). The server has applied the abandoned request all the same.
Deadlock by waiting
A handshake with no partner never completes, so a synchronous world fails by waiting. In extra/send_completion.go, part 3, main receives on a, a second goroutine waits to receive on b before it would send on a, and nobody sends on b:
a, b := make(chan int), make(chan int)
go func() { a <- <-b }()
fmt.Println(<-a)
Every goroutine is then asleep, and the Go runtime ends the program with the report recorded below. In the lab, part 2 builds the handshake and reproduces and repairs this state.
$ go run send_completion.gofatal error: all goroutines are asleep - deadlock!
Does a deadlock need a lock, or only waiting? The lock was never the cause by itself: waiting is, and a lock is one thing a thread can wait for. Coffman, Elphick and Shoshani described a deadlock as the state in which "a group of two or more tasks is unable to proceed—each task monopolizing resources and waiting for the release of resources currently held by others in that group"27. With a message in place of the released resource, the description covers the cycle below. There each goroutine waits for a message the other will send only after its own send. The missing partner of the recorded run is the degenerate case, a wait on a message that no process holds. The runtime's criterion covers both: no goroutine can ever run again. Any operation that waits can play the part a lock played in session 7, and here a receive on a channel nobody serves plays it, as a send on a full or unbuffered channel can. Section 3 named the cost of sharing nothing, waiting replaces racing, and the failure of a world that waits is deadlock. The runtime's message is a last resort: it appears only when no goroutine can run again, and a goroutine in time.Sleep, or a pending timer, hides the deadlock of the others (run: extra/0b/deadlock_shapes.go)28.
The recorded run has one shape of deadlock, a missing partner: a goroutine waits on a channel that no goroutine will ever serve. The other shape is the cycle of section 2, two threads taking two locks in opposite orders. In its channel form, two goroutines each send to the other first and receive afterwards:
cycle_min.go, the lines showntoMain, toOther := make(chan int), make(chan int)
go func() { toMain <- 101; fmt.Println(<-toOther) }()
toOther <- 1
fmt.Println(<-toMain)
Where two threads taking two locks in opposite orders can deadlock, depending on the interleaving, this cycle deadlocks in every run. On unbuffered channels each send waits for a receive that the other goroutine reaches only after its own send, and both wait forever. The runtime stops the program with "all goroutines are asleep - deadlock!", both goroutines blocked in a send (run: blocks/cycle_min.go).
Tu et al. found many such bugs in six Go systems: a missing send, a missing receive, or a channel never closed, each leaving a goroutine waiting forever29. Some come from a goroutine that holds a mutex while blocked on a send, which mixes the two worlds29.
8. Buffer capacity: waiting, deadlock and the sender's knowledge
Buffer capacity is the block's second parameter, set independently of the resolution of contests.
Hoare set the buffer to zero, Kahn to infinity, and the RC 4000 to a finite pool, and the actors of section 9 sit at the unbounded end. For buffering, an actor's mailbox can be read as the RC 4000's queue of one process with the limits taken off. There is no pool to exhaust and no limit on the messages a sender may have outstanding, so that a send returns at once30,31. The RC 4000, by contrast, limited the messages a sender could have outstanding, within one finite pool3. The comparison is a lens, not a lineage: as far as is known, the actor model arose independently of the machine (section 9). Its other differences, which do not concern capacity, come in section 9. Eventual delivery, the subject of point 4, is a fairness assumption and not a property of the buffer. In a network without choice or test for emptiness and with one writer and one reader per channel, buffer size does not decide the results, only waiting, deadlock and what the sender knows. In a program with choice or with a merge, several writers on one channel, buffer size can also change which outcomes are possible. Asynchrony, a send that does not wait for its receiver, is a matter of buffering; nondeterminism, once nothing is shared, is a matter of contests, tests for emptiness and processes nondeterminate inside (section 5). The two are set independently: an unbounded Kahn network is asynchronous and deterministic, and a CSP program with a guarded choice is synchronous and can be nondeterministic. Where a contest exists, capacity can still change which outcomes are possible, as the sentence above says.
In the kitchen, a synchronous channel is a plate handed from hand to hand, both cooks present at the same moment. A buffered channel is a pass-through shelf with a few slots, where a plate is put down and the cook walks off. The cook who puts down waits only when the shelf is full, and the cook who takes waits only when it is empty.
The cycle of section 7 shows what the number on a channel changes. At capacity 1, both sends land in a slot, both goroutines reach their receives, and the program ends. If each goroutine sends two values before it receives, the cycle returns at capacity 1, and capacity 2 breaks it again (run: blocks/cycle.go). The cycle's channels, one writer and one reader each and no choice or test on them, are point 1 below in a small case: a bounded buffer stalls where an unbounded one would not. The two goroutines' prints share one output, whose order can change at GOMAXPROCS 12; the values received never do (run: extra/s1/cycle_print.sh). The missing partner of section 7 stays at every capacity, since a receive on a channel nobody writes waits forever (run: extra/0b/deadlock_shapes.go, capacities 0, 1 and 10). Capacity decided who waits and whether the program deadlocks; it computed no other value. A buffer can break a cycle; it cannot supply a missing partner.
-
Determinism comes from the absence of competition, not from the buffer. A Kahn network gives the same values with any buffer size. With buffers that are too small it can deadlock where unbounded buffers would not. Bounding can only cut the output short; it never changes a value produced. The pipelines of section 4 that have one writer per pipe are an instance: their pipes are bounded, and for the same input in the same environment their answers stay the same.
-
Size zero changes what a choice means. With a handshake, a
selectpicks among partners that are ready at that instant, and the sender knows the value arrived. With buffers, sends finish early, more interleavings of sends and receives become possible, and the sender knows less. The hello world of section 4, traced withmake(chan string)and withmake(chan string, 1):Step Capacity 0: who waits Capacity 1: who waits sender 1 sends sender 1, until main receives nobody: the value enters the slot sender 2 sends sender 2, until main receives sender 2, until the slot is emptied main receives nobody: main takes one of the two blocked senders, which continues nobody: main takes the slot's value, and sender 2's value enters the slot main receives nobody: main takes the other sender, which continues nobody: main takes the slot's value In both columns the scheduler decides which sender comes first, by the order in which it lets the senders reach the channel. The specification leaves the matching of blocked senders open14, and the gc runtime serves them in the order in which they blocked13 (run:
extra/0b/sender_order.go). Here capacity changes who waits, not who can be served first. In a larger merge capacity can change that too. With two senders, A and B, and a receiver that starts receiving only after A signals that its send has completed, nothing is served at capacity 0, only A's value can come first at capacity 1, and either value can from capacity 2 on (run:extra/s1/merge_capacity.go). -
A bounded buffer moves the senders' contest. When it is full, senders compete for the next free slot instead of for the receiver. In Go, a send case in a
selectis ready on a buffered channel when there is room, and on an unbuffered one when a receiver is waiting14. On a closed channel it is always ready, and the send panics. -
Guaranteed eventual delivery with no bound on delay is where actors get unbounded nondeterminism. The source is the fairness assumption and not the buffer; Hoare's unbuffered example of section 10 would have the same property under a fair implementation. Senders never wait and delivery is assumed eventual, so outcomes can become infinite (section 10).
-
Backpressure against load shedding. Unbounded buffers give no backpressure: a slow receiver goes unnoticed while its mailbox grows. Bounded buffers whose rule for a full buffer is to block the sender give backpressure, paid for in blocking bugs; a buffer that drops the message or returns an error instead sheds load without blocking.
The survey's three kinds of send sit on this scale11:
| Kind | Buffer | Sender knows after send |
|---|---|---|
| Synchronous | none | the receiver has the value |
| Buffered | finite | the value is queued; the receiver may not have it yet |
| Asynchronous | effectively unbounded | nothing about the receiver; its message may describe state that is no longer current |
The RC 4000 sits on the bounded side. The actors of section 9 sit at the far end, where a sender knows nothing about the receiver.
Buffer capacity and the semaphore count
Where a merge, a split or a choice admits more than one outcome, capacity does not choose among them; it decides which interleavings of sends and receives can occur. Capacity 0 excludes every interleaving in which a sender has finished a send its receiver has not taken. Capacity k excludes those in which a sender runs more than k values ahead of its receiver. An unbounded buffer excludes none beyond the rule that a value is received after it is sent. Among the interleavings left, the scheduler and the runtime choose. They choose, for instance, which of several blocked senders is served next. The specification leaves that choice open14, and the gc runtime decides it in the order the senders blocked13 (run: extra/0b/sender_order.go).
Session 7's locks play the same part for threads: more synchronization leaves fewer interleavings. The exact counterpart of capacity, though, is the initial count of a counting semaphore, not the lock. A lock forbids two threads to be in one region at the same time; a capacity forbids one side to run more than k steps ahead of the other. Dijkstra's bounded buffer enforces exactly that, with a semaphore of empty positions that starts at the buffer's size, taken by the producer before it writes and given back by the consumer after it reads4. A channel matches a semaphore only in that number. The semaphore's current count then changes as the buffer fills and empties, and a channel also carries the values. A buffered channel is therefore closer to Dijkstra's semaphores and an array.
| Capacity of a channel (session 8) | Semaphores (session 7) |
|---|---|
| 0, the handshake | a rendezvous: one semaphore signals that a value is there, a second that it was taken, a third keeps a second sender out (run: extra/0b/SemaphoreBuffer.java); Java's SynchronousQueue, which has no internal capacity, "not even a capacity of one"32 |
| k | Dijkstra's bounded buffer: "number of queuing portions" starts at 0, "number of empty positions" at the buffer's size, and a binary semaphore, "buffer manipulation", guards the array4; the producer ran at most k items ahead (run, k = 1 and 3) |
| unbounded | Dijkstra's first buffer: "number of queuing portions" and the binary semaphore, no count of empty positions, so the producer never waits4 |
More synchronization always leaves fewer interleavings. It leaves fewer observable outcomes only where a contest exists, a merge, a split or a choice, or for threads a race the constraint covers. In a Kahn network every value produced is the same at every capacity, a small one only cutting the output short (point 1).
In both cases the number is fixed at creation, make(chan T, k) in Go and new Semaphore(k) in Java, and the code that uses it only sends and receives, or acquires and releases. Each still offers a way to read the current state:
len(ch)andcap(ch)give the number of queued elements and the size of a Go channel's buffer14;availablePermits()gives a Java semaphore's count, a method "typically used for debugging and testing purposes"33.
A value read this way can be out of date by the next statement, since another thread can change it at once. A decision taken on it is a test for emptiness in the sense of section 5, and its outcome depends on timing. With twelve processors, goroutines that sent after checking that the buffer had room found it full in 2,370 of 100,000 trials, and in none with one processor (run: extra/0b/len_peephole.go). Java threads that acquired after seeing a permit would have blocked in 611, 598 and 668 of 20,000 trials (run: extra/0b/PermitsPeephole.java). Dijkstra's semaphore has no such operation: P and V "represent the only way in which the concurrent processes may access the semaphores"4.
Summary of block 1
From a distance, the buffer looks like a detail of how communication is built. It is more than that, and it leads back to session 7. The interleavings that message passing seemed to remove are still there. Where processes share nothing and messages carry values, they no longer appear as data races on shared memory. They appear as contests between messages at a point where several parties meet, as in the two-sender hello world of section 4, or as a test for emptiness. Whether the scheduler's choices can reach the results is decided by the model: under Kahn's conditions they cannot; with a merge, a split, a choice or a test for emptiness they can. Capacity, the initial count of a semaphore under another name, decides how much room the scheduler has: who waits, when, and how many interleavings remain. The interleavings go to two places. In the runtimes of this story, and in any runtime whose processes share one address space, the interleavings of accesses to shared memory go into the one trusted place underneath. That place is the buffer and the lock that orders them (section 3). The scheduler's choices that can reach the results go, in every model, to the few points where the program admits a contest: a merge, a split, a choice, or a test for emptiness (section 5). Message passing does not remove the interleavings; it moves them into one trusted place and onto a few marked points.
Block 1 has three parts. Sections 1 to 6 set up the problem and its vocabulary, alternating between machines and models; sections 4 and 5, Kahn's determinism and the three resolutions with the places where nondeterminism enters, are its core. Section 7 is the language that marks the contest in the program text: CSP. Hoare's 1978 paper proposed it as a programming language10, and his 1985 book made it an algebra26. Both occam and Go took it up, Go through Newsqueak and Limbo (appendix B). Section 8 opens the second parameter, capacity, where the models meet finite machines. An unbounded buffer does not exist, and a bounded one, when full, blocks the sender, drops the message or returns an error (point 5).
Is buffer capacity an implementation detail or a part of the model? It depends on what is observed. If only the values are observed, capacity is a detail in a Kahn network, since every value produced is the same at every size. If liveness is observed too, it is not, since a small buffer can deadlock where an unbounded one does not. With a choice or a merge, capacity can change which outcomes are possible, and it belongs in the model. The story shows both stances. Hoare put the size in the model, zero, for the reasons section 7 gives. The algebra of 1985 is built on the communication as one event shared by two processes (section 7, reason 1, a later reading and not a reason of 1978). Agha, in section 9, abstracts the bound away and defends unbounded buffers the way a semantics defends an infinite stack30. A parameter is an implementation detail only relative to what is observed. Block 2 takes the request half of the RC 4000's conversation to its full form, the mailbox: a send that never waits, an arrival order that the model leaves free, and a delivery that the model assumes.
Sources
The sources cited in this block, in the order of their first citation.
- datamuseum.dk, RC4000, RC8000 and RC9000, DDHFwiki, anonymous notes of 1996, page last edited 17 December 2023. The RC 4000's date, 1967.
- Politiken, Monday 8 September 1969, p. 4, "Ny EDB-filosofi fra Regnecentralen", signed "cauchi", scanned at datamuseum.dk, bits 30002322. The prototype at the ammonia plant at Puławy (spelled "Polawy" there), designed by Haldor Topsøe, and the fertilizer counted; Per Brinch Hansen, aged 30, leading the group (read on the scan, the age with less certainty than the rest); Peter Kraft named with "the first Danish multiprogramming system (… specially for the Polish machine)". Cited at Politiken, 8 September 1969.
- P. Brinch Hansen, The Nucleus of a Multiprogramming System, Communications of the ACM 13(4), April 1970, 238–241, 250; retyped reprint, https://people.cs.uchicago.edu/~shanlu/teaching/33100_fa15/papers/nucleus.pdf. The nucleus's three jobs, the names of processes, a process's incomplete knowledge of the others, and the details left to the system manual (p. 238); the four primitives and the two further ones, the one queue per process, the identification of a conversation, dummy answers for a missing or removed receiver, pool exhaustion, the operator's interrupt key, and semaphores rejected for "black sheep" (pp. 239 to 240); the limit on outstanding messages, the parent's storage and the risk of a conversation (p. 240); device handling and process control inside the nucleus, the uninterruptable mode, creation and removal in an interruptible process, the sizes of 4,800 and 6,200 words and the times of a send, a wait and a conversation (p. 241), the single processor implied and not stated, and the sizes read with less certainty than the times; the acknowledgement of Dijkstra (p. 250).
- E. W. Dijkstra, Cooperating Sequential Processes, EWD 123, Technological University Eindhoven, September 1965 (the date Brinch Hansen 1970 gives; the archive's catalog gives 1968); printed in F. Genuys (ed.), Programming Languages: NATO Advanced Study Institute, Academic Press, 1968, 43–112. The manuscript and its dates; it defines semaphores (§3.2), P and V "the only way in which the concurrent processes may access the semaphores", which appear earlier, in EWD 74; the unbounded buffer (§4.1) and the bounded buffer with its "number of empty positions" (§4.3).
- ISO C++ working draft, [intro.races] (6.10.2.2), paragraph 17, in the eel.is rendering consulted on 27 October 2026, https://eel.is/c++draft/intro.races. A data race results in undefined behavior.
- The Go Memory Model, version of June 6, 2022. A racy program without meaning in C and C++ (informal overview); a racy read of a word-sized location sees some write; a race on a multiword value may tear it and corrupt memory; an implementation may report a race and stop the program.
- The Java Language Specification, Java SE 21 edition, chapter 17, "Threads and Locks", §17.4 (memory model, happens-before) and §17.7 (non-atomic treatment of
doubleandlong). What a racy read may return in Java. Cited at JLS 17.7; JLS 17.4. - G. Kahn, The Semantics of a Simple Language for Parallel Programming, in J. L. Rosenfeld (ed.), Information Processing 74, Proceedings of IFIP Congress 74, North-Holland, 1974, 471–475 (editor and pages as dblp gives them, not seen in the copy); read in a retyped copy without page numbers. Processes on FIFO channels with one writer each and blocking reads (§2, restriction iii: a process "cannot be waiting on data coming from one or another of its input lines"); a process a function of the histories of its inputs, and a network determinate (§2.2); the fixed-point argument; a schedule fair enough, and less output under an unfair one (§3); the nucleus of the RC 4000 cited as reference [3] among the systems whose primitives are "not too far from reality" (§6), where the word determinate stands. Cited at §§2.2 and 6.
- E. A. Lee and T. M. Parks, Dataflow Process Networks, Proceedings of the IEEE 83(5), May 1995, 773–801; read in the preprint of 27 March 1995, whose section numbers are used. Kahn process networks (§2.1) and networks of monotonic processes determinate (§2.2); the five ways to add nondeterminism (§2.2); sequential processes with blocking reads continuous (§2.4.6). Cited at §2.1 and §2.4.6.
- C. A. R. Hoare, Communicating Sequential Processes, Communications of the ACM 21(8), August 1978, 666–677, doi 10.1145/359576.359585. Input and output as primitives and the common store (p. 666); named partners, no buffering, guarded choice (p. 667); disjoint processes (p. 668); termination and input guards only (p. 669); explicit naming, port names and buffering as alternatives (§7, p. 675); the bounded buffer, the dining philosophers and the prime sieve among its examples; the alternative command, with boolean guards that may be true together and an input from a terminated process that fails (pp. 669–670); the comparison with Kahn's design, its four differences, and the credit of "an elegant theory which permits proof" (§7.7, p. 676); fairness (p. 676); the reference list, which cites Dijkstra, Kahn as [12] and Brinch Hansen only for Concurrent Pascal as [2]. Cited at pp. 666, 668; pp. 667, 669; §7.3, p. 675.
- G. R. Andrews and F. B. Schneider, Concepts and Notations for Concurrent Programming, ACM Computing Surveys 15(1), March 1983, 3–43. Message passing defined, and direct naming (p. 25); the port, one receiver and many senders (pp. 26 to 27); the three kinds of send and the assertions a sender can make after each (p. 27); send and receive in guards an open problem (p. 29). Cited at pp. 25 to 27.
- P. Brinch Hansen (ed.), RC 4000 Computer Reference Manual, 2nd edition, Regnecentralen, Copenhagen, June 1969, RCSL 55-D1, §7.1, p. 33. Interrupts disabled on entry to the interrupt program (§7.1); instruction-exception interrupts never disabled (§7.2).
- The Go runtime,
src/runtime/chan.goandsrc/runtime/select.go, read at tag go1.27.3, https://github.com/golang/go/blob/go1.27.3/src/runtime/chan.go and https://github.com/golang/go/blob/go1.27.3/src/runtime/select.go. The channel ashchan, with a buffer, queues of waiting goroutines and a lock (chan.go, lines 34–55); waiting senders and receivers served first in, first out (chan.go, 858–904); a select that locks its channels in address order (select.go, 206–252). - The Go Programming Language Specification, language version go1.27 (May 26, 2026), sections "Channel types", "Send statements", "Receive operator", "Select statements", "Close" and "Length and capacity". Unbuffered and buffered channels, FIFO order and no order among concurrent senders, a send on a closed channel and a
nilchannel, when a send case is ready, the uniform pseudo-random choice ofselect, and nothing said of locks. - G. Kahn and D. B. MacQueen, Coroutines and Networks of Parallel Processes, Information Processing 77, Proceedings of IFIP Congress 77, North-Holland, 1977 (the printing not opened); read in IRIA Rapport de Recherche 202, November 1976 (OCR scan; pages cited as the PDF's). The availability of an item at an input port "cannot be tested", "a deliberate decision to exclude time-dependent input/output behaviour" (§2.3); a channel bound to a single producer, several consumers sharing an input line, each reading every value (§2.4); Conway's coroutines and the Unix "pipelining combinator" cited.
- IEEE Std 1003.1-2024,
pipe(), https://pubs.opengroup.org/onlinepubs/9799919799/functions/pipe.html, andwrite(), https://pubs.opengroup.org/onlinepubs/9799919799/functions/write.html. A write to a full pipe blocks; a write to a pipe that no process reads fails withEPIPEand raisesSIGPIPE. - K. Thompson and D. M. Ritchie, UNIX Programmer's Manual, Third Edition, Bell Telephone Laboratories, February 1973, page pipe(II) dated 15 January 1973, in the archive v3man.tar.gz. Pipes documented in 1973.
- D. M. Ritchie, The Evolution of the Unix Time-sharing System, AT&T Bell Laboratories Technical Journal 63(8), part 2, October 1984, 1577–1593, doi 10.1002/j.1538-7305.1984.tb00054.x; first given in 1979. Pipes appeared in Unix in 1972; the communication files of the Dartmouth Time-Sharing System (section "Pipes").
- M. D. McIlroy, untitled memo, signed 11 October 1964, scan at https://plan9.io/cm/cs/who/dmr/mdmpipe.pdf (page "10", read as an image). "We should have some ways of coupling programs like garden hose".
- M. E. Conway, Design of a Separable Transition-Diagram Compiler, Communications of the ACM 6(7), July 1963, 396–408. A module coded as "an autonomous program which communicates with adjacent modules as if they were input or output subroutines" (p. 396); the coroutine structure of the COBOL compiler designed at Case.
- select(2), FreeBSD System Calls Manual, FreeBSD 15.1, page dated 25 June 2020. HISTORY: "The select() system call appeared in 4.2BSD"; DESCRIPTION: the descriptor sets replaced by "subsets consisting of those descriptors that are ready".
- M. K. McKusick, Twenty Years of Berkeley Unix, in Open Sources, O'Reilly, 1999 (read through a summarizing fetch, with less certainty than a page opened). 4.1c distributed in April 1983; "In August 1983, the system was released as 4.2BSD".
- select(2), 4.1cBSD manual page, headed 12 February 1983, in the 4.1cBSD tree of The Unix Heritage Society. The system call in the test release distributed in April 1983.
- S. J. Leffler, Bug fixes and changes in 4.2BSD, 1983, 4.2BSD
usr/doc/uchanges. "The multiplexed file facilities are no longer part of the system. They have been replaced by the socket, and related, system calls". - select(2), 4.2BSD manual page, dated 2 July 1983. "Select returns, in place, a mask of those descriptors which are ready".
- C. A. R. Hoare, Communicating Sequential Processes, Prentice Hall International, 1985; read in the electronic edition of 2022. Events shared by processes and channels as the standard notation (pp. 45, 113–114); an alphabet "a permanent predefined property of an object" (§1.1, p. 1);
COPY(§4.2, p. 115) and the chaining operator>>(§4.4, pp. 131–132); buffering in a cyclic network and deadlock (§7.3.2, p. 219); three of the four differences from Kahn's networks, without the one on termination (§7.3.3, p. 221); occam named (§7.3.6, pp. 223–224). Cited at §4.2, p. 115; §4.4, pp. 131–132; pp. 113–114. - E. G. Coffman, M. J. Elphick and A. Shoshani, System Deadlocks, ACM Computing Surveys 3(2), June 1971, read in a scan of the journal pages. The description of a deadlock and "deadly embraces" (p. 67); the four conditions (p. 70).
- The Go runtime,
src/runtime/proc.go, functioncheckdead, read at go1.27.1 and compared with go1.27.3, https://github.com/golang/go/blob/go1.27.3/src/runtime/proc.go. The report "all goroutines are asleep - deadlock!" (line 6519) and no report while timers are pending (lines 6512–6516). - T. Tu, X. Liu, L. Song and Y. Zhang, Understanding Real-World Concurrency Bugs in Go, ASPLOS 2019, 865–878, doi 10.1145/3297858.3304069; read in the authors' copy, whose fourteen pages are numbered here by position (proceedings page 864 + n). The uses of each primitive (§3.2); 171 bugs in six systems; blocking bugs and their causes (pp. 6 to 7); non-blocking bugs (pp. 10 to 11); message passing "does not necessarily make" programs less error-prone (§7, "Discussion and Future Work"). Cited at p. 7.
- G. Agha, Actors: A Model of Concurrent Computation in Distributed Systems, MIT AI-TR-844, June 1985, also his PhD dissertation at the University of Michigan; pages are the report's printed ones. The argument for asynchronous communication (pp. 19 to 22); the commands of his language SAL, among them
become(p. 49) andsend-to(p. 64), with the creation of actors (chapter 3); the atomicity of a communication kept by buffering (p. 20); arrival order arbitrary (p. 22, §2.4); delivery guaranteed after an arbitrarily long delay, and no guarantee that a message is "meaningfully" processed (pp. 23 to 24). - J. De Koster, T. Van Cutsem and W. De Meuter, 43 Years of Actors: A Taxonomy of Actor Models and Their Key Properties, AGERE 2016, 31–40, doi 10.1145/3001886.3001890; read in the authors' copy. Agha's three primitives, credited there to his book of 1986 and his article of 1990 (p. 33); the Isolated Turn Principle (pp. 33 to 34); races across messages (p. 34); classic actors and the processes family (pp. 33, 35).
- Oracle, Class SynchronousQueue, Java SE 26 API documentation. Each insert waits for a remove; no internal capacity, "not even a capacity of one";
size()"Always returns zero". - Oracle, Class Semaphore, Java SE 26 API documentation. A semaphore "maintains a set of permits";
availablePermits()"is typically used for debugging and testing purposes".