[DGD] Object upgrading

bart at wotf.org bart at wotf.org
Tue Jul 3 13:40:12 CEST 2018


On Mon, 2 Jul 2018 23:55:28 -0700, Raymond Jennings wrote
> 
> After doing the paperwork for patchers, when a non inheritable object
> is compiled, the next thing I do is atomically enter a loop to
> call_touch the object and all of its clones so that the next attempt
> to access them will get it pulled over for a JIT patch.
> 
> Once the clones are marked, the last thing I do before I end the task
> is suspend the system and arrange to have the object's upgrade
> function called, after which the system releases itself.

I do not understand this particular step, wouldn't this be triggered due to
the object that needs a call to its upgrade function also getting handled by
call_touch?

Second question, why suspend the system here, and not at the beginning of this
entire process?

<snip> 

> 
> My own concern is that the most obstructive part of the process is 
> the loop that marks all the clones.  Actually finding all the clones 
> is a bit of a chore.  For the time being I'm using a loop that does 
> a find_object sweep through the object table.

I've looked at this approach, and use it as a fallback to reconstruct object
and clone data. The advantage of this approach is of course not ending up
pulling in all clones, which my current alternative does, as it uses a linked
list which is maintained in the objects/clones, hence it has to call a clone
to find the pointer to the next clone if any. I use a loop that only pulls in
a limited number of objects/clones, and after this, uses a call_out to itself
for the next batch. (note that the object handling this is excluded from
call_out blocking while the system is suspended).

Obviously the above loop first gets the next clone pointer before doing a
call_touch on the current clone.

I considered using this setup to just call the appropriate upgrade functions,
but that did not work out very well, those functions can be relatively
expensive and can fail.

But.. that solution is not exactly perfect as it ends up pulling in all
objects and clones affected by the recompile.

Being able to find all clones relatively quickly is something I also use
elsewhere, and it does not require a global data structure for keeping track
of this.

Bart.
--
https://www.bartsplace.net/
https://wotf.org/
https://www.flickr.com/photos/mrobjective/




More information about the DGD mailing list