← Lessons

quiz vs the machine

Platinum1750

Concurrency

The Actor Isolation Guarantee

Each actor owns private state and processes one message at a time.

5 min read · advanced · beat Platinum to climb

What an actor is

An actor is a unit of concurrency that owns private state no other actor can touch. Actors communicate only by sending messages to each others mailboxes.

The isolation guarantee

An actor processes its mailbox one message at a time:

  • its state is reachable only from inside the actor
  • messages are handled sequentially, so its own state never sees concurrent access
  • other actors run in parallel but cannot reach in

Because each actors state is single threaded from its own view, there are no internal data races even on a multicore machine.

What isolation does not solve

Isolation removes races on actor state but not all concurrency bugs. Messages can arrive in surprising orders, mailboxes can grow unbounded, and request reply patterns can deadlock if two actors wait on each other.

Key idea

An actor isolates private state and handles messages one at a time, so its state is race free, while ordering, mailbox growth, and reply deadlocks remain real concerns.

Check yourself

Answer to earn rating on the learn ladder.

1. Why is an actors internal state race free?

2. Which problem does actor isolation NOT remove?