[MUD-Dev] [TECH] Event Queues in MUDs

Daniel.Harman at barclayscapital.com Daniel.Harman at barclayscapital.com
Wed Dec 19 13:03:19 CET 2001


Still progressing slowly with my game, and started work on
implementing an event queue/scheduler class. Does anyone have any
particularly good priority queue algorithms for this type of thing?

I want to make a fairly generic scheduler, so I'm thinking along the
lines of multiple lists of events categorised by time until the
event. This would speed up insertion sorting as I would expect to
have a lot of events ticking fairly frequently along with things on
a period of several hours/days. In fact they don't have to be
multiple queues, I just need multiple pointers into one to simulate
this.

I'm not kean on making scheduling approximations as it might lead to
unforseen concurrency situations.

In order to use as little CPU as possible, I'm planning to use a
windows multi-media timer set to trigger when the top event in the
queue is due.  This does mean that events inserted at the front of
the queue will require reseting of the timer, but I don't forsee
this being a problem. The alternative of having a timer ticking at a
set interval and checking the queue each time seems sloppy.

Anyway, comments/optimal algorithms/things I need to consider?

Dan

_______________________________________________
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