A WorkingSetMachine has a boolean state indicating whether or not it is a custodian.
This state determines whether ROD objects are sent eagerly or lazily by its peers. Lazily means that the objects are sent on demand. A non-custodian needs to send a message to a custodian to request ROD objects.
To determine whether a WorkingSetMachine
is a custodian the function IsCustodian
can be called
(it must be called inside a CSpace
transaction). It has the following signature:
bool IsCustodian(const WorkingSetMachine* wsm);
This happens implicitly on non-custodians when AsyncGet()
is called on a pref
/cref
which references a ROD object which isn't currently present in its WorkingSet
.
By default a WorkingSetMachine
is a custodian. This can be changed by calling the SetIsCustodian
function. This must be called inside a CSpace
transaction.
void SetIsCustodian(WorkingSetMachine* wsm, bool isCustodian);
The peers of a custodian send ROD objects eagerly (albeit asynchronously) - the idea being for a custodean to eventually get its own copy of all the ROD objects in the working set.
The peers of a non-custodean send ROD objects lazily.
It doesn't make sense for non-custodeans to connect to each other directly because neither will tend to be able to service the requests for ROD objects because they tend not to have them all.