3 ms·
Disagree with the characterization of CSP. CSP as I understand it has channels as the main building block for interprocess communication. Channels can be synchr
by noelwelsh 13y ago
Disagree with the characterization of CSP. CSP as I understand it has channels as the main building block for interprocess communication. Channels can be synchronous or asynchronous, and bounded or unbounded. The important point is that a channel is a value (you can pass it to a method, return it from a method) and usually has a type.
Actors are like a simplified CSP where each (lightweight) thread has a single input channel. In the case of Akka this mean you lose type information because control messages are mingled with data messages and you can't assign any useful type of them.
Disruptor is mainly a pattern and implementation for high efficiency -- big queues, minimum number of threads, and some tricks using CAS operations and the like. I wouldn't call it a model of concurrency -- it's basically a particular implementation of CSP.
- calibraxis 13y agoYes, authors cited their sources, so we can understand their perspective better.
- calibraxis 13y agofacepalm That should be "authors should..." Which is BTW an absurdly trivial observation to post in retrospect, on top of it.
- abecedarius 13y agoCSP as Tony Hoare invented it specified a static set of processes where communication was also synchronization, and first-class channels didn't appear until years later -- so it's understandable where that claim came from. (AFAIK Concurrent ML was the first practical language with that feature; Wikipedia says Hoare coauthored a paper some years earlier). As long as we're in a well-actually: in the Actors model each channel has one receiving thread. If it were that each thread has one input channel, that wouldn't keep different threads from consuming from the same channel, which is different. Also, the original papers talked about an implementation spawning threads to handle each message -- even two threads to a message, one to compute the messages sent in response and one to compute the next state to handle the next message with, etc. More comparison of the two: http://en.wikipedia.org/wiki/Communicating_sequential_processes#Comparison_with_the_Actor_Model http://en.wikipedia.org/wiki/Communicating_sequential_proces...