0 day streak
6. ConcurrencyActor model

Actor model

The actor model structures a concurrent program as many small independent workers, called actors, that never share memory and communicate only by sending messages. Each actor has a private mailbox and handles one message at a time, perhaps updating its own state, messaging other actors, or creating new ones. Since only the actor touches its own state, nothing needs locking, which removes a whole class of races. Picture an office where everyone has an inbox and nobody reaches into anyone else’s desk. Erlang and Elixir are built on it and Akka brings it to the JVM; it stretches naturally across machines, and supervisor actors restart workers that crash.

In this lesson: A mailbox animation.