MUD-Dev
mailing list archive

[ Other Periods  | Other mailing lists  | Search  ]

Date:  [ Previous  | Next  ]      Thread:  [ Previous  | Next  ]      Index:  [ Author  | Date  | Thread  ]

Re: [MUD-Dev] Event Scheduling



[J C Lawrence:]

> 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.

Do you handle any currently-ripe entries in the queue before any new
tasks that are immediately ripe? You likely want to do that to avoid
starvation in cases of server overload.


I didn't reply to the original question, since my event queue is simply
a sorted linked list, hence my insert time is O(n), and my delete time
is O(1). Manipulation of that queue has never shown up in my profiling,
however - it's time is tiny compared to actually executing the events.

-- 
Don't design inefficiency in - it'll happen in the implementation.

Chris Gray     cg#ami-cg,GraySage.Edmonton.AB.CA
               http://www.GraySage.Edmonton.AB.CA/cg/



_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev



[ Other Periods  | Other mailing lists  | Search  ]