Training
×

Create a remote object – implicit (auto)

As an alternative to creating a reference object for an existing remote object, you can also create a new remote object. The remote object resides on the remote node but is owned by the creating process. When that owning process terminates, the remote object is deleted, just like any local objects created by the process (see exception below).
In all creating calls, the parameters are as in the corresponding local creating function, with the addition location parameter and an additional flags value REFCOUNT.
If REFCOUNT is not specified, the remote object is deleted when the reference object is deleted (either explicitly by calling DeleteRtReferenceObject or implicitly by ending the process)
If REFCOUNT is specified, then the remote objects reference count is one after completing the CreateGlobalRtXxx call. Every CreateRtReferenceObject increments the reference count. Every deletion of such a reference object decrements the reference count and when it becomes zero, the remote object is deleted. It is thus possible that the remote object exists after its creating process has terminated.
Note that the function CreateGlobalRtMemoryHandle must be used with care, as it maps a memory region on the remote node without any validation on the address.