Communicating sequential processes¶
Category: Communication · Status: stub · Lessons: chapter 05, Message passing (planned)
One line: Tony Hoare's model of independent processes that interact only through synchronous channels — the idea behind Go's goroutines and channels.
Also called: CSP.
How it connects¶
flowchart LR
n_actor_model["Actor model"]
n_csp["Communicating sequential processes"]
n_message_passing["Message passing"]
n_unbuffered_channel["Unbuffered channel"]
n_actor_model ---|vs| n_csp
n_csp -->|is a| n_message_passing
n_csp -->|uses| n_unbuffered_channel
classDef center stroke-width:3px
class n_csp center
classDef outside stroke-dasharray: 4 3
class n_actor_model,n_message_passing,n_unbuffered_channel outside
- Is a kind of: Message passing
- Is built on: Unbuffered channel
- Often confused with: Actor model
- See also: Concurrency models, Goroutine
In each language¶
| Go | goroutines and channels; the Go FAQ ↗ explains why Go built its concurrency on the ideas of CSP |
| Java | SynchronousQueue ↗, whose docs compare it to the rendezvous channels of CSP and Ada |
| Elsewhere | Clojure's core.async ↗, with channels and go blocks |
Where to read more¶
- In the books: Concurrency in Go, Katherine Cox-Buday — ch. 2, 'Modeling Your Code: Communicating Sequential Processes'
- In the books: Seven Concurrency Models in Seven Weeks, Paul Butcher — ch. 6, 'Communicating Sequential Processes'
- In the books: Python Parallel Programming Cookbook, Giancarlo Zaccone — ch. 5, 'Distributed Python' → 'Communicating sequential processes with PyCSP'
- In the books: Learn Concurrent Programming with Go, James Cutajar — ch. 9, 'Programming with channels' → 'Communicating sequential processes'
- In the books: The Go Programming Language Phrasebook, David Chisnall — ch. 10, 'Concurrency Design Patterns' → 'Share Memory by Communicating'
- Notes: Communicating Sequential Processes (CSP) ↗
- Reference: Wikipedia: Communicating sequential processes ↗