Actor model

The actor model, invented by Carl E. Hewitt in 1973, is an alternative to the thread & lock approach how concurrent applications can be implemented without the problems parallelism usually arises. The basic idea is to create a number of actors who act in parallel with the restriction that they can only handle one message at a time.

Actors communicating via asynchronous messages

An actor itself could be represented as an object in a programming language being an instance of an actor class. The only way for actors to communicate with each other is to send and receive messages asynchronously. Actors themselves can create more actors dynamically. Each actor defines how a message is going to be handled. The message handler itself is usually a function modifying the actor's state. Thanks to the fact that each individual actor first finishes the processing of one message before going on to the next one there is no need to synchronize or lock the actor's data. It still leverages multi-core systems by letting multiple actors "act" in parallel. However the order of the arrival of messages is undefined and they are sent asynchronously. A well-designed actor based system can be run on multiple machines with actors sending messages over the network, each computing a different part of the result.