[Twisted-Python] A problem with runUntilCurrent

Bill la Forge laforge49 at yahoo.co.in
Mon May 17 10:14:57 EDT 2004


Glyph,
 
I couldn't resist digging into the code you sent. I noticed that you 
changed the code to use callLater. But there's a problem with that,
I suspect...
 
In base.runUntilCurrent, there's this while loop...
 
        while self._pendingTimedCalls and (self._pendingTimedCalls[-1].time <= now):
            call = self._pendingTimedCalls.pop()
.
.
.
 
This means that when you do a callLater with a delay of 0, 
runUntilCurrent will immediately call the delayed function, which then
calls callLater, and again the delayed function is immediately called, etc.
 
So the net result of the timing test you ran was that the reactor
main loop just hung until the test was completed.
 
So it ran fast. But it really didn't run at all. ;-(
 


Bill la Forge
http://www.geocities.com/laforge49/
Yahoo! India Matrimony: Find your partner online.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20040517/c8b497e5/attachment.htm 


More information about the Twisted-Python mailing list