3 ms·
does anyone know what is the trade off between csp and actor?
by bulldoa 9y ago
does anyone know what is the trade off between csp and actor?
- rubiquity 9y agoIt varies by implementation but with Actors the processor is addressable (process ID) and with CSP the transport, typically channels, are what is addressable. To make it more concrete, with CSP you send the message to a channel and you don’t know who is reading from that channel. With Actors you send a message to a specific Actor. Time for opinions: It’s pretty trivial to get channel semantics with Actors by having an Actor that acts as a reverse proxy. It’s harder, or maybe less conventional, to have Actor semantics with CSP. You would have to assign a channel to each processor (goroutine in Go) and maintain a reference to that. At the end of the day, they are just abstractions and we are always working with references to memory, IO, and CPU, so the differences are mostly philosophical. Actors resonate better with the model of computation and program structure I have built up in my head over time.