Actors

A BMD virtual machine is not actually created directly. (As a matter of fact, it can't be created direcly, as it has a private constructor.) Instead, an Actor is created, which owns its virtual machine. The actor is responsible for holding all of the information related to a specific agent, such as the instruction list, the global fields, and the list of available functions. Actors can contain a link to another actor, in which case the virtual machine exports remote calls to the linked virtual machine / actor.

An alternative architecture was previously considered, in which all actors operate under one global virtual machine. RPCs to linked actors would be simulated on the same stack, but each actor would appear to be running on its own virtual machine. This architecture has some useful benefits; for instance, keeping track of the call stack across actors is much simpler. (This issue is not actually fully solved in my current implementation. The call stack is traced within an actor, but calls that the other actor makes are not fully recorded. ) However, in the separate-VM structure, one has to worry less about stack corruption between actors.

Mason Smith 2008-06-11