Actor model - illyfrancis/scribble GitHub Wiki
From http://letitcrash.com/post/20964174345/carl-hewitt-explains-the-essence-of-the-actor
someone's takeaway
Actor basis
By Carl Hewitt
What is an actor?
Fundamental unit of computations which embodies:
- processing
- storage
- communication
One ant is no ant... One actor is no actor, there has to be system of actors.
Fundamental properties of actor
- Everything is actor, even mailboxes? Where does the recursion ends?
- An actor has a mailbox
Since a mailbox is also an actor, it too will have a mailbox, and so the recursion begins! The recursion ends with axioms.
Axioms
When an actor receives message it can do:
- it can create more actors,
- send messages to actor it knows
- designate how you handle the next message it receives (e.g. new account balance i.e. state)
And that's all!!!
"Concepturally, messages are processed one at a time, but the implementation can allow for concurrent processing of messages"
This is not the same as continuation, which is the lambda expression that you execute after doing the current one and is a concept for single threaded processing.
You can create a future while computation. Where you can pass around the future.
An actor can also send message to itself (i.e. recursion) and to avoid deadlocks there's a notion of a future.
Addresses
- Q: Is address of an actor the identify of an actor? A: No.
- Q: How do you tell if the two actors are the same? via address? No. No way to tell.
- Address != Identify
- Address (~~ capability)
- One actor can have one address for many actors if you're replicating behind the scenes
- One actor can have many addresses that forward to one another (via proxy actors)
Messages
(A1) ---> (A2)
and A1 sends messages m0 and m1 to A2
There's no order guarantees. m1 arrives before m0.
There's no channel. It's a direct communication. But the delivery is at "best effort", and no guarantee, and delivered at most once.
Non-determinism vs in-determinism. (00:18)
- start message
- go message
- stop mesage
How do actors relates to petri-nets? (00:21)
Synchronism (00:24)
Synchronization is built into the actor model because messages can be received one at a time by an actor.
Arbitor (00:25)
Turing machine cannot do this ;-)
Has indetermincy inside.
What is:
- given
- has two inputs
- has two outputs
- it needs to output 1 but not both