[MUD-Dev] Event Scheduling

J C Lawrence claw at kanga.nu
Tue Feb 8 10:31:39 New Zealand Daylight Time 2000

On Mon, 7 Feb 2000 13:10:06 -0500 
Phillip Lenhardt <philen at funky.monkey.org> wrote:

> For those of you who have heavy-use event schedulers, what
> algorithms are you using? 

Mine is written in C++, with a standard STL priority queue for
pending events in botht he Dispatchor and Executor, and short
circuit evaluation (ie never hits the priority queue) for those
incoming entries that are adjudged as being already ripe, or will be
ripe by the time they reach a waiting thread (if a thread is ready).
This saves the (occassionally) non-trivial insertion cost as well as 
lock contention on the queues.

> I was wondering if anyone was getting significantly better
> performance from their scheduler. 

I've had srtificial test cases which I know generated event rates
circa a few hundred thousand a minute (mostly things like mass
numbers of mobiles moving back and forth thru a door), bot the vast
majority of those event logs would have been short circuited
directly to the thread pool without ever really touching the queue

The general intent is that only a small minority of the total number 
of "events" will ever actually invoke the queing system, and that,
further, due to the size and processing capacity of the Executor's
thread pool, that the pool of events awaiting execution by threads,
will always be small.

My bottlenecks are on physical IO, not compute, so I don't tend to
worry much about these aspects too hard beyond chosing reasonable

J C Lawrence                                 Home: claw at kanga.nu
----------(*)                              Other: coder at kanga.nu
--=| A man is as sane as he is dangerous to his environment |=--

MUD-Dev maillist  -  MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list