Fork me on GitHub

damn, I’m happy I bought a MBP 15" 2015 days before the new one came out…

Denis G16:06:03

Guys, that’s so special about actor model? It’s just a function called on a queue, whereby the messages are inserted and popped synchronously. But since messages are executed sequentially, it’s not really concurrent. So what’s so cool about it? It’s like instead of acquiring the lock on the data you are working with, you acquire lock around the function which is called. Is it really SO SPECIAL?

Alex Miller (Clojure team)16:06:21

The cool thing about the actor model is supervision


A single actor is not concurrent, but many actors working together are. The "official" view of the actor is that you need 3 things: 1) A way to send a message to an actor 2) A way to create an actor from a running actor 3) A way to specify how the next message given to the actor should be processed


So at a really low level, that's it. What Erlang and Akka have done is extended that to supervision and the like, but at the core actors are another form of programming paradigm that has its own tradeoffs.


Message passing systems are becoming more and more important as we reach many core CPUs. The new Threadripper 2 from AMD is a rather horrific design for shared memory systems. As time goes on we'll probably see more issues in that area.

Denis G16:06:14

@alexmiller so supervision is something that actor has, but CSP doesn’t? Other that that, replace messagebox with channel and you get something really similar to CSP? Or not so simple, since channels are 1:1, message-boxes are 1:N?


They're really different. Actor systems don't guarantee delivery or even message ordering. CSP guarantees both.

Denis G16:06:28

it’s kinda TCP (CSP) vs UDP (Actor model), right?


But on the other hand it's pretty much impossible to extend a CSP channel over a network. And since it requires about 2-3 locks, performance will degrade the more cores are involved.


Somewhat like TCP, but it's even worse. since when you do (chan) you create a channel that's a handoff. Your write won't complete until the other end has taken the message. That's really hard (impossible I think) to do across a network


So yeah, actors are a bit more like UDP in that way, and then systems like Erlang and Akka add automatic retries, supervision, etc.

Denis G16:06:52

@tbaldridge but in TCP you also send ACK messages, to confirm the receiving of the message


(Hewitt invented the actor model)

Denis G16:06:18

I’ve started to watch that video, but it was kinda dry, or maybe I wasn’t really concentrated I’ve been watching this right now:

Denis G16:06:25

Thanks for your help 😉 It always feels good to learn new concepts


BTW, something I do when I'm bored is go here: and pick a link from the right-hand side and start reading up on it. There's a lot more out there than FP/OOP

👍 16

when i get bored i usually go to youtube. maybe that’s why i suck 😛