patternMinor
Differences between the Actor Model and Communicating Sequential Processes (CSP)
Viewed 0 times
actorthesequentialdifferencesprocessesbetweencommunicatingcspandmodel
Problem
When we look at the Actor Model and Communicating Sequential Processes we see that they are both trying to do concurrency based on message passing, yet they are distinct.
(We see implementations of the CSP Model in go-lang's goroutines (and Clojure's core.async) and the Actor Model in Scala's Akka toolkit)
I'm trying to get a simple list of the differences between the Actor Model and CSP. So far I have:
Is this correct? Is there anything I'm missing?
Assumptions
(We see implementations of the CSP Model in go-lang's goroutines (and Clojure's core.async) and the Actor Model in Scala's Akka toolkit)
I'm trying to get a simple list of the differences between the Actor Model and CSP. So far I have:
- actors message passing is asynchronous, CSP message passing is synchronous
- actors are composable, CSP is not (necessarily)
- actors always have unbounded non-determinism, CSP may have bounded or unbounded non-determinism
- actors have variable topology whereas CSP has fixed topology
- actors have the principle of locality, CSP does not have locality
- actors are designed around their behaviour, CSP doesn't not necessarily have this
Is this correct? Is there anything I'm missing?
Assumptions
- When I say 'actor model' - I mean the theoretical basis behind the implementation in Scala's Akka framework
Solution
Here is how I think Erlang works. I believe Akka is very similar.
Each process has a single mailbox. Messages are put into the
receiver's mailbox by the sender, and fetched by the receiver using
pattern matching. This matching process can change message ordering in
the sense that the oldest message in a mailbox may not match, but a
younger one does. In this case the younger one is consumed
first. Other than that, message ordering is preserved.
With this in mind, the asynchronous $\pi$-calculus extended with input
pattern matching input from buffer describes Erlang (and hence Akka)
semantics accurately, although one needs to do a bit of work in the
encoding, since the $\pi$-calculus doesn't have the restriction to
single channels per process. However, one usually doesn't want an
encoding, but rather a calculus that models the target system
directly. Such a calculus exists, and it's called Featherweight
Erlang. It is by Mostrous and Vasconcelos. Their paper focusses on
typing, but you can ignore that and just look at the untyped calculus in Section 3.
Each process has a single mailbox. Messages are put into the
receiver's mailbox by the sender, and fetched by the receiver using
pattern matching. This matching process can change message ordering in
the sense that the oldest message in a mailbox may not match, but a
younger one does. In this case the younger one is consumed
first. Other than that, message ordering is preserved.
With this in mind, the asynchronous $\pi$-calculus extended with input
pattern matching input from buffer describes Erlang (and hence Akka)
semantics accurately, although one needs to do a bit of work in the
encoding, since the $\pi$-calculus doesn't have the restriction to
single channels per process. However, one usually doesn't want an
encoding, but rather a calculus that models the target system
directly. Such a calculus exists, and it's called Featherweight
Erlang. It is by Mostrous and Vasconcelos. Their paper focusses on
typing, but you can ignore that and just look at the untyped calculus in Section 3.
Context
StackExchange Computer Science Q#19506, answer score: 6
Revisions (0)
No revisions yet.