Actor model implementation
In computer science, actor model implementation concerns implementation issues for the actor model.
Cosmic Cube
The Caltech Cosmic Cube was developed by Chuck Seitz et al. at Caltech providing architectural support for actor systems. A significant difference between the Cosmic Cube and most other parallel processors is that this multiple instruction, multiple data machine uses message passing, rather than shared variables, for communication between concurrent processes. This computational model is reflected in the hardware structure and operating system, and is also the explicit message passing communication seen by the programmer. According to Seitz :It was a premise of the Cosmic Cube experiment that the internode communication should scale well to very large numbers of nodes. A direct network like the hypercube satisfies this requirement, with respect to both the aggregate bandwidth achieved across the many concurrent communication channels and the feasibility of the implementation. The hypercube is actually a distributed variant of an indirect logarithmic switching network like the Omega or banyan networks: in shared-storage organizations, uniform communication paths are typically used. However, with the hypercube architecture, communication paths can traverse varying numbers of channels, resulting in different latencies. This makes it possible to optimize performance by placing processes in nodes based on communication locality.
J–Machine
The J–Machine was developed by Bill Dally et al. at MIT providing architectural support suitable for actors.This included the following:
- Asynchronous messaging
- A uniform space of actor addresses to which messages could be sent concurrently regardless of whether the recipient actor was local or nonlocal
- A form of actor pipelining
Prototype actor programming language
Hewitt presented a prototype actor programming language in the sense that it directly expresses important aspects of the behavior of actors.Messages are expressed in XML using the notation
:<tag> for
The semantics of the programming language are defined by representing each program construct as an actor with its own behavior. Execution is modeled through the passing of Eval messages among these constructs during runtime.
Environment actors
Each Eval message has the address of an actor that acts as an environment with the bindings of program identifiers. Environment actors are immutable, i.e., they do not change.When Request customer] is received by an actor environment, a new environment actor is created such that
when the new environment actor receives
Request customer’] then if identifier is the same as identifier’ send customer’ Returned, else send Environment
Request customer’].
The above builds on an actor EmptyEnvironment which
when it receives Request customer], sends customer ThrownNotFound[identifier
When it receives a Bind request EmptyEnvironment acts like Environment above.
Expressions
The prototype programming language has expressions of the following kinds:; <identifier>
; send <recipient> <communication>
;<recipient>.<message>
;receiver... <pattern>i <expression>i...
; behavior... <pattern>i <expression>i...
; let <identifier> = <expression>value in <expression>body
; serializer <expression>
Example program
An example program for a simple storage cell that can [contain any actor address is as follows:The above program which creates a storage cell makes use of the behavior ReadWrite which is defined as follows:
The above behavior is pipelined, i.e., the behavior might still be processing a previous read or write message while it is processing a subsequent read or write message..
For example, the following expression creates a cell x with initial contents 5 and then concurrently writes to it with the values 7 and 9.
The value of the above expression is 5, 7 or 9.