Chapter 10. Automatic module initialization with OmniRpcModuleInit API

Table of Contents
What's auto module initialization
Programming with OmniRpcModuleInit API

By using OmniRpcModuleInit API, when modules of a remote executable program are activated, the call initialize function is enabled automatically. So, you can write programs efficiently for master/worker programs which require worker initialization. We call this OmniRPC's restricted persistency model "Automatic Initializable Module".

What's auto module initialization

Auto module initialization is a function which calls the initialization method automatically when modules of a remote executable program are invoked.

By using OmniRpcHandle API, you can write efficient programs which keep data on a remote executable program, but you should write the program which is used by the remote executable program. We only specify the remote functions which are specified by OmniRpcCall at the start, the OmniRPC system executes and runs appropriate remote executable programs for requests. But we cannot know which remote executable programs are allocated by the OmniRPC system, so it is impossible to set the data beforehand.

In some OmniRPC master/worker programs, the master and worker share common data. Workers calculate its data with different parameters which are taken from the master. Auto module initialization is convenient in cases like this. In OmniRPC, if there is a function named "Initialize" in a module, "Initialize" is called automatically when a new remote executable program is activated for an other function's RPC call. Common data are set in initialization, and it can be efficient to reuse this data when function calls are called by real varied parameters. The bigger the costs of setup, the bigger are the effects.