
----- Original Message ----- From: "Tommi Virtanen" tv@twistedmatrix.com To: "Twisted general discussion" twisted-python@twistedmatrix.com Sent: Monday, January 02, 2006 4:19 AM Subject: Re: [Twisted-Python] Re: r15451 - Fix test failures under windowsby changing the eventual-send operation to
Paul G wrote:
full ordering/sorting hit on inserts. if you think a little harder, this can be made fairly efficient with a sparse circular list of event buckets, with each bucket being a fifo queue of events to be fired at that time. whether it's worth bothering with the additional complexity is up for discussion.
Sounds like a not-yet-polished version of what the kernel does.
http://lwn.net/Articles/156329/
(note I'm not really convinced twisted should implement a similar thing, atleast right now)
yep, the kernel implementation is another (similar) way to skin the same cat. please note that the kenel implementation makes a certain tradeoff because: 1) it expects most timers to be deleted before expiring 2) it has a bounded jiffies range. in the context of twisted, i'd rather take the hits piecemeal on inserts/deletes with a sparse circular array rather than all at once as with their logarithmic bucket scheme. i have some of this implemented in some scheduling code i wrote a while back, but it'd need some massaging. if there's any interest, i may produce a patch, but i don't want to do the work if it's not gonna get accepted (i'm lazy ;).
with that said, the specific issue warner is having could be fixed at the source if the current implementation is deemed sufficient. this can be accomplished by finding a better time source to use under windows and/or implementing a crude version of lagrange timestamps to use as indices.
-p