[Home] [Groups] - Message: [Prev in Group] [Next in Group]
22397: Re: [MUD-Dev] [TECH] Event Queue System
[Full Header] [Plain Text]
From: Lars Duening <lars@bearnip.com>
Newsgroups: nu.kanga.list.mud-dev
Date: Thu, 14 Feb 2002 20:36:02 -0700
References: [1]
Organization: Kanga.Nu
the_sage2000@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@bearnip.com
PGP Key: http://www.bearnip.com/lars/pgp-lars.asc
_______________________________________________
MUD-Dev mailing list
MUD-Dev@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev