liveBook · Manning

Communicating sequential process

As explained in Learn Concurrent Programming with Go

Communicating sequential processes (CSP) is a formal concurrency model in which isolated sequential processes interact by exchanging messages through synchronized channels.

Communicating sequential processes (CSP) model concurrency as isolated sequential executions that exchange messages through synchronized channels. Each execution keeps its own state instead of sharing memory directly, reducing interference and many race conditions. section 9.1.2 section 1.5.2

Go applies CSP ideas with goroutines and channels. Channels are synchronized and unbuffered by default, while Go additionally treats channels as first-class objects that can move through function calls or other channels. section 9.1.2 section 7.0

CSP-style programming supports several practical communication structures:

  • Connect goroutines by passing messages rather than allowing direct interference through shared memory. section 9.0
  • Use a quit channel to notify goroutines that they should stop executing. section 9.4
  • Build pipelines in which goroutines accept input channels and return output channels. section 9.4
  • Use fan-in to merge inputs, fan-out to load-balance work when order does not matter, and broadcast to replicate messages. section 9.4

A concurrent Go application using CSP

A concurrent application can model separate executions as goroutines and coordinate them by sending messages over channels. Because channels are first-class objects, the program can create, pass, and rearrange communication paths while it runs. section 9.1.2

How Learn Concurrent Programming with Go covers it

How deep it goes
Defines isolated state, copied messages, synchronized channels, Go differences, and common channel patterns, while deferring deeper CSP detail.
Examples
Uses concurrent Go application diagrams and channel patterns including quit, pipeline, fan-in, fan-out, and broadcast.
What it assumes
Builds on memory sharing and classic synchronization primitives before contrasting them with message passing.
What you can do after
Apply CSP-style concurrency in Go using goroutines, channels, pipelines, shutdown signals, and channel composition patterns.
How it connects
Connects CSP with goroutines, channels, message passing, memory sharing, race conditions, pipelines, fan-in, fan-out, and broadcast.

Also explained in

Compare how 2 books explain communicating sequential process →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Concurrent Programming with Go. The section links point to the parts of the book it draws on.