ChorusOS 4.0 Hot Restart Programmer's Guide

4.2.1 Initial Load

Use the C_INIT command arun with the -g option, or the function call hrfexec() to load a restartable actor from stable storage into persistent memory. Both arun and hrfexec() provide support for specifying the persistent credentials of a restartable actor when the actor is initially loaded.

Actors created directly using actorCreate(2K) or acreate(2K) are not hot restartable and cannot use the Hot Restart Controller API.

When an actor is run as a restartable actor, the Hot Restart Controller checks whether an actor identified with the specified name is already registered. If this is not the case (as is the case for an initial load), the Hot Restart Controller first solicits the Persistent Memory Manager to allocate the persistent memory blocks which will store the actor's actor image and executing image. If successful, it registers the name of the new actor as a restartable actor, running in the specified group.

The subsequent load and start of the persistent actor is the same as for an actor run using a member of the afexec(2K) function family (see the man page for a description of this process). The difference is that the actor is loaded from its actor image (in persistent memory) and not from stable storage.


Note -

A restartable actor's name remains registered in the Hot Restart Controller for the lifetime of its actor group. The lifetime of the group may extend beyond the lifetime of the actor. It is the programmer's responsibility to ensure that no two restartable actors will attempt to register with the same name in the Hot Restart Controller.


Once a restartable actor has been registered and loaded, it runs under the control of the Hot Restart Controller. If the actor fails, the failure will provoke the restart of all the direct members of its restart group. These direct actors are then responsible for restarting any indirect actors registered in the group. To query an actor's restart group, use hrGetActorGroup(2RESTART):

#include < hr/hr.h >
hrGetActorGroup(int aid)