DEV Community

Akshansh Gusain
Akshansh Gusain

Posted on

CSP - Oversimplified

CSP stands for communicating sequential processes which is a formal language for describing patterns of interaction in concurrent systems. First mentioned in Charles Antony Richard Hoare’s paper “Communicating Sequential Processes” in the Association for Computing Machinery(ACM). CSP is a simple concept of solving concurrency through two primitives of programming 1. Input 2. Output

The paper abbreviates the term processes to any individual logic that needs input to run and produce output. (You can visualise this as a Goroutine)

For communication between the processes, Hoare created input and output commands: ! for sending input into a process, and ? for reading output from a process. Each command had to specify either an output variable or a destination. Sometimes these two would refer to the same thing, in which case the two processes would be said to correspond. In other words, output from one process would flow directly into the input of another process. Go Channels! Sounds familiar?

Go is the first language to incorporate principles from CSP in its core, and bring this style of concurrent programming to the masses.

Top comments (0)