[DGD] Rewriting the main loop

Raymond Jennings shentino at gmail.com
Sun Dec 2 03:04:54 CET 2018


On Sat, Dec 1, 2018 at 5:37 PM Schmidt, Stephen <schmidsj at union.edu> wrote:

> On Sat, Dec 1, 2018 at 8:28 PM Raymond Jennings <shentino at gmail.com>
> wrote:
>
> > As for the reason:
> >
> > It is my personal opinion that DGD should be as responsive as possible,
> and
> > it should place human interaction before internal timing from callouts.
> >
> > This implies pushing background work like swapping and garbage collection
> > to the, well, background.
> >
>
> I'm not sure I understand the distinction here. Won't it often, perhaps
> generally, be the case that the callouts are part of the human interaction?
>

It depends on what the interaction is.


> Obviously this is application-dependent, but in the kinds of applications I
> used to do, most callouts originated in some kind of command handling.
>

It's case by case, but my intention is to keep interactivity at a higher
priority than doing background work.

But here's an example:

Reading your mud mail, chatting on chatlines, reading help files, banning
people, etc, would be user I/O tasks, so they're something I choose to
prioritize over callouts (such as the heartbeats of mobs and players,
periodic healing, hapless knights digesting in a dragon's stomach).  They
directly interface with users in contrast to the callout stuff, so I prefer
to boost interactivity by prioritizing them over callouts.

Swapping is lower priority than both callouts and user I/O because it can
"get in the way" when stuff needs to happen.

Generally speaking:

Over time, if your server is properly provisioned, DGD should have enough
CPU time to take care of all of its chores.  The change in the main loop
for me is just to make sure that it stays responsive, but these are
supposed to be short spikes of interactive load.  If foreground work is
routinely starving out housekeeping then chances are either your server is
underprovisioned or you're being victimized by a denial of service attack.

> Steve
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd



More information about the DGD mailing list