Intermediate Topic 24 of 51 Concurrency & Parallelism
Communicating Sequential Processes
Concurrency via channels between processes.
How it works
Communicating Sequential Processes, formulated by Tony Hoare, is a formal model of concurrency in which independent sequential processes interact solely by synchronous message passing over channels, with no shared memory. A send blocks until a receiver is ready, forming a rendezvous, and choice operators let a process wait on several channels. Process algebra allows reasoning about deadlock and equivalence. It influenced occam, Go's channels and select statement and Clojure's core.async.
Where it is used
Designing concurrent systems as networks of processes, verifying protocols with model checkers such as FDR, and structuring Go programs around channels use CSP ideas.
Common pitfall
Unbuffered channels can deadlock when processes wait on each other in a cycle, and forgetting to close channels or drain them leaks goroutines. Channel-based designs still need care with shared data referenced through messages. CSP is not the same as the actor model: CSP channels are first-class and synchronous, while actors use named mailboxes and asynchronous sends. Use select with timeouts and clear ownership.
Where it fits in the course
Communicating Sequential Processes is topic 24 of 51 in Concurrency & Parallelism, rated Intermediate. It follows Actor Model. The next topic is Go Goroutines and Channels.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Concurrency & Parallelism quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Concurrency & Parallelism quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Communicating Sequential Processes?
Where do people use Communicating Sequential Processes?
What is the most common mistake with Communicating Sequential Processes?
What should I learn before this topic?
How can I practice it?
Is Communicating Sequential Processes hard to learn?
How long does it take to learn Communicating Sequential Processes?
Which topics are related to Communicating Sequential Processes?
What should I study after Communicating Sequential Processes?
Related topics
- Actor Model (Concurrency & Parallelism)
- Go Goroutines and Channels (Concurrency & Parallelism)
- Green Threads (Concurrency & Parallelism)
- Lock-Free Data Structures (Concurrency & Parallelism)
- Processes (Operating Systems)
- Sequential Circuits (Computer Architecture & Logic)
- Stochastic Processes (Math for Computing)