Remote Procedure Calls

When an RPC instruction is encountered, the VM is inspected to see if it contains that function. VM functions are implemented as normal C++ functions, which are registerd to the VM. This allows a user of the BMD VM library to add their own functions to the VM to be available to the programs.

When the function name is not found in the VM, the linked actor is checked for the function. (The list of functions the actor has access to in its instructions is generated by the -function execution signals.3.5.1). The VM has a method called VM::call_function, which sets up a call stack using supplied arguments and runs the code.

One disadvantage to this approach is that counting the number of execute instructions becomes more difficult, as transferring control to the linked VM is treated as the execution of only one instruction. (Again, this is one of those problems that I didn't quite solve.)



Mason Smith 2008-06-11