[MUD-Dev] [TECH] Event Queue System

Lars Duening lars at bearnip.com
Thu Feb 14 20:36:02 CET 2002


the_sage2000 at juno.com wrote on Thursday, February 14 2002, 16:02:32:

> Greetings everyone!

> I have a few questions:

> 1) Has anyone implemented an event queue system and can give me
> advise on doing it?

LPmud implements two event mechanisms. One is the 'heartbeat' and is
called for every cycle (approx. 2 seconds) of the mud. The
information about which objects have their heartbeat activated is
held in a double-linked ringlist.

The second mechanism, called 'call_out's, are arbitrary function
calls scheduled for future times. The information is held in a
simple linked list, ordered by call times, similar to your idea. As
a twist, the nodes in the list don't store the absolute time of
call, but the time difference to the previous call.

The drawback of using such a simple list is of course that
insertions take a long time when you have lots of events pending -
using a more advanced structure (skip lists, for example) might be
useful then.

--
Lars Duening; lars at bearnip.com
PGP Key: http://www.bearnip.com/lars/pgp-lars.asc

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list