This description of the Actor Model is intended to build intuition about how the model works using reasonably precise terms. However, it is not a formal mathematical description. We are focusing on the so-called “classic” model [1], which is treated with much more formality in earlier literature [2] [3]. Overview A configuration is a set […]
Implementing Actors in JavaScript
JavaScript does not exactly have an ideal semantic model for implementing Actors. Execution is single-threaded and sequential. Most objects are mutable by default. However, it has the advantage of being the most available and widely used computer language, so it seems worthwhile to show how actors can be used in this environment. Asynchronous Programming JavaScript […]
Producer/Consumer Rate-Matching
Flow control is a critical feature in a network of asynchronous communicating processes. Our fanciful exploration of a yak-shaving barber’s shop provided us with patterns we can apply to more general problems. The bounded-buffer mechanism is a generalization of our barber’s waiting room. It mediates between producers and consumers, matching the rate of production with […]
“Sleeping Barber” in Humus
The “Sleeping Barber” problem is another classic concurrency example. As with our previous discussion of “Dining Philosophers”, actors allow a novel approaching to solving this problem. We will adjust a few of the details to enhance the metaphor and have a bit of fun with it. Our metaphorical barber provides yak shaving services. Yaks arrive […]
Futures and Capabilities
In the Actor Model, concurrency is the default. Sequencing must by arranged explicitly. An important case of sequencing occurs when there is a data dependency between different parts of a system. One part produces a value that another part needs to perform its function. One mechanism for sequencing data-dependent operations is to create a Future. […]
Implementing Actors in Kernel
Now is the time we come full-circle in our exploration of Kernel/Scheme/LISP and show how Actors can be implemented on this foundation. This should dispel the notion that Actors are just functions/procedures. Sure, when an Actor receives a message you could say that the message is “applied” to the Actor’s current behavior. In that sense, […]
High Availability for Mutable Shared State
Mutable shared state is the root of all evil in concurrent systems. The history of concurrent computation is a basically the story of approaches to managing mutable shared state. The thread model, which has long held the dominant position, leads to intractable complexity [1]. The actor model captures state in the behavior of an actor. […]
Erlang-style Mailboxes
One significant difference between message-passing in Erlang and the pure Actor Model is the Erlang concept of mailboxes. Actors don’t have mailboxes, at least not in the sense that they can be queried. Messages simply arrive at some non-deterministic time after they are asynchronously sent, invoking the current behavior of the actor. However, in Erlang, […]
Actors Make Better Observers
The Observer pattern causes temporal coupling in systems with synchronous message passing. This can lead to failure in Object-Oriented systems. Asynchronous messaging avoids the pitfalls. Actor-based implementations more accurately realize the original intent of the pattern. The intent of the Observer pattern is to “define a one-to-many dependency between objects so that when one object […]
Message Passing, part 1 – Synchronous Rendezvous
What do we mean when we say “message-passing”. For Object-Oriented developers from the Smalltalk tradition, message-passing involves a dynamic method lookup, invocation of that method with the target object as an implicit parameter, and return of a result object. By contrast, message-passing in synchronous communication models (such as Ï€-calculus) involves “rendezvous” between sender and receiver, […]
Deconstructing the Actor Model
The Actor Model of Computation, as defined by Carl Hewitt [1] and elaborated by Gul Agha [2], defines three primitive operations. These operations are “Send”, “Create” and “Become”. The “Send” operation transmits an asynchronous message to a known receiver. The “Create” operation constructs a new actor with a specified initial behavior. The “Become” operation defines […]