Illustration
The video Hewitt, Meijer and Szyperski: The Actor Model is analysed in terms of questions and answers. Being able to answer these questions is a first step toward understanding the subject.

What is an Actor?

  1. An Actor is the fundamental unit of computation.
  2. It embodies three things:
    • Processing
    • Storage
    • Communication
  3. It has at least one address to which messages can be sent.
  4. Different Actors may share the same address.
  5. When an Actor receives a message, it can:
    • create more actors
    • send messages to other actors using addresses it knows about
    • decide what it is going to do with the next message it receives
  6. Messages are processed one at a time even if in practice, they may be processed in parallel.

What is an Actor Model?

  1. An Actor Model is a system of Actors.

What is a Future?

A future is an Actor. It behaves like so: it is basically a storage cell that can be written to only once, but read from multiple times. If a read occurs before the write, the read-reply is delayed until the write provides a value. This effectively suspends readers until the write occurs. Note, however, that there is no blocking in an actor system. The asynchronous reply to a read request is simply deferred until a value is available.

  • If an Actor sends a message to itself, then: will it deadlock?
  • i.e. can it wait for a message to be sent by itself?
  1. An Actor may use a Future to avoid deadlocks.
  2. If it needs a result computed by itself, it can create a future.
  3. The future represents the result of that computation.
  4. So:
    1. The current computation reaches a point where it needs a result computed by itself.
    2. A future that represents this result is built.
    3. The computation waits for the result.
    4. When the result is available, the computation continues.
  5. There is no deadlock.

Can packets be dropped?

  1. Communication is best effort.
  2. Messages are delivered at most once.
  3. If a0 sends a message m to a1 and a0 does not receive an ACK, then: a0 may resend m to a1.
  4. It means that messages must be persisted in some way.

What is non-determinism?

  1. It is the order of events obtained by means of probabilities like flipping a coin: it cannot be predicted.

What is indeterminacy?

  1. It is the order of events obtained by the way things worked out in the system: it cannot be predicted.

What is an interrupt?

Interrupts are signals from a device, such as a keyboard or a hard drive, to the CPU, telling it to immediately stop whatever it is currently doing and do something else. For example, a keyboard controller can send an interrupt when a character key was pressed.

Then the OS can display the character on screen immediately, even if the CPU was doing something completely unrelated before, and return to what it was doing afterwards. When a specific interrupt arises, the CPU looks up an entry for that specific interrupt from the Interrupt Descriptor Table, then the CPU calls the code for the Interrupt Service Routine (ISR) at the address pointed to by that entry.

Can we do non-deterministic computing?

  1. There are non-deterministic models.
  2. There is a Turing Machine which can transition to multiple states for a given symbol and state combination. The computation can then proceed simultaneously along different paths and decide among them later.
  3. It is known as a Non-Deterministic Turing Machine (NDTM).