

CSP uses channels for message passing, whereas actors use mailboxes.Processes in CSP are anonymous, while actors have identities.Some differences between the actor model and communicating sequential processes: In Java world, Akka is commonly used for this. Which is convenient, but it's a bit harder to reason about and mailboxes potentially have to hold a lot of messages.Įach process has a single mailbox, messages are put into the receiver's mailbox by the sender, and fetched by the receiver.Īctor model is implemented in languages such as Erlang and Scala. It is inherently asynchronous, a message sender will not block whether the reader is ready to pull from the mailbox or not, instead the message goes into a queue usually called a "mailbox". This is similar to the everything is an object philosophy used by some object-oriented programming languages. It's also in many ways easier to reason about.ĬSP is implemented in languages like Go with goroutines and channels.Īctor model was put forth by Carl Hewitt in 1973 and it adopts the philosophy that everything is an actor. The advantage of that blocking based mechanism is that a channel only needs to ever hold one message. It is fully synchronous, a channel writer must block until a channel reader reads.


Although there is decoupling between the processes, they are still coupled to the channel. In CSP we use "channels" for communication and synchronization. It made a breakthrough in Computer Science, especially in the field of concurrency. In this article, we will discuss how CSP and actor concurrency models work.Ĭommunicating Sequential Processes (CSP) is a model put forth by Tony Hoare in 1978 which describes interactions between concurrent processes.
