[DGD] Object upgrading
Felix A. Croes
felix at dworkin.nl
Mon Jul 2 11:31:22 CEST 2018
Raymond Jennings <shentino at gmail.com> wrote:
> What's the best way to make sure all objects get upgraded?
>
> Right now, I have a tight loop in ObjectD that atomically calls
> call_touch on all clones of a patchable object, and then leaves a
> background callout in PatchD to eventually nudge them all.
>
> Is this the best way to do it?
The problem to solve with object upgrading is that an unbounded number
of objects has to be changed, and changing them all in one task would,
at best, be extremely inefficient, and at worst would crash the server
by running out of memory.
DGD's unique solution is the ability to set a trigger for an object that
will be called before the object can be used in any manner, which will
not load that object in memory. This will guarantee that each affected
object can be JIT upgraded before it is used.
Of course, this will only work as long as discovering the set of affected
objects does not also load them in memory. Furthermore, you have to be
careful that you don't touch any of these objects from the same task
that performs the recompilation, or the upgrade will be triggered before
it can properly take place.
Once the recompilation and trigger-setting has taken place, you can choose
to either perform the upgrade at leasure in a way that doesn't load too
many objects in memory at once, or you can leave the object as-is and
perform the upgrade whenever the object is used again. In the latter case,
when an object has been upgraded more than once, it must be able to perform
a mult-stage upgrade in a single call.
Regards,
Felix Croes
More information about the DGD
mailing list