[DGD] Why use callouts in klib to increment resources?

Felix A. Croes felix at dworkin.nl
Mon Oct 22 09:59:38 CEST 2018


Tony Demetriou <tony.demetriou at gmail.com> wrote:

> I don't know what's happening under-the-hood, but in Skotos world, we did a
> *lot* more processing on Ironclaw than other games, and were the first to
> start running into those "out of ticks" errors during normal game use.
> (Other games only got that error when they made an infinite loop.)

Skotos uses an older version of the kernel library, 1.2.38 if I'm not
mistaken (though that may differ per game).  So at first I thought that
you were talking about a feature which I later removed: gradual reduction
of the available ticks once "tick usage" approaches the quota limit.

However, looking at the commit history, I see that I made the last
relevant change in 2004, preceding kernel library version 1.2.38.  And
the current code is not what I thought it was.  It does still check
if the quota has been exceeded, and if so, runs out of ticks immediately.
The cloud library does the same.

While this is useful for preventing what you call infinite loops, it is
also problematic because tick updates happen very often, and every tick
update can invalidate concurrent tasks using call_limited, because
those have to consult the currently active limit to get started.  It
is a problem I was aware of, but which I still have to deal with, as
I just realized.

Regards,
Felix Croes



More information about the DGD mailing list