14 ms·
Three words: Communicating Sequential Processes.
by jklowden 2y ago
Three words: Communicating Sequential Processes.
- hbogert 2y agoLike in Go? I still think it's difficult there. Is it made easy? Sure. But it's not simple
- treyd 2y agoIn part because Go isn't true CSP, it's just inspired by it. It's very easy to accidentally share data between threads even when exclusively using channels to communicate. Couple this with the cases where it is better to use shared state with mutexes and you get can bit by them being easy to screw up or forget.
- kaba0 2y agoIt doesn’t make it easy. You can still have dead/live locks.
- atemerev 2y agoI prefer plain actor model, it is so simple that it happily abstracts the entire problem away. CSPs require a lot of reasoning beforehand.
- syndicatedjelly 2y agoCan you share more than 3 words and explain?
- cies 2y agoI thought of an answer in 2 words reading the title, namely: Shared state. Actor model is indeed a nice way to prevent shared state. So are "The Elm Architecture" and state-less web server on top of a db. I have a hunch "Communicating Sequential Processes" and "Shared state" are somehow describing the same thing in different words (or from a different perspective).
- 01HNNWZ0MV43FF 2y agoThey're supposed to be opposed. "Communicate by sharing" vs "share by communicating". Communicating has nicer ownership rules, but not all runtimes make it easy to e.g. communicate raw video frames to a compositor But yeah in the end it's all Turing machines and you can emulate anything with anything else
- kaba0 2y agoThe actor model is still prone to many forms of race conditions, among others, live and dead locks.