[Twisted-Python] pollreactor 1sec timeout

Hello, Why is the pollreactor rescheduling once per second? I modified it like this and it still works so far. --- Twisted/twisted/internet/pollreactor.py.~1~ 2004-11-23 03:48:21.000000000 +0100 +++ Twisted/twisted/internet/pollreactor.py 2004-11-24 07:59:30.508119608 +0100 @@ -120,9 +120,7 @@ class PollReactor(default.PosixReactorBa POLLIN=select.POLLIN, POLLOUT=select.POLLOUT): """Poll the poller for new events.""" - if timeout is None: - timeout = 1000 - else: + if timeout is not None: timeout = int(timeout * 1000) # convert seconds to milliseconds try:

On Nov 24, 2004, at 4:35 AM, andrea@cpushare.com wrote:
Hello,
Why is the pollreactor rescheduling once per second? I modified it like this and it still works so far.
I can see no reason to think that's necessary, and will remove it if no one comes up with a reason. James

On Wed, 2004-11-24 at 10:35 +0100, andrea@cpushare.com wrote:
Why is the pollreactor rescheduling once per second? I modified it like this and it still works so far.
This might be a leftover from before signal handlers used wakeUp() (they all use wakeUp now I hope). I remember a similar reason for timeouts on windows, again probably because we weren't using wakeUp. (wakeUp is our method name for using the self-pipe trick).

Hello, On Wed, Nov 24, 2004 at 10:05:01AM -0500, Itamar Shtull-Trauring wrote:
(wakeUp is our method name for using the self-pipe trick).
So basically you write a byte into the pipe from the signal, so poll will return, right? 1sec latency for a signal would been pretty huge anyway btw ;), so I guess for the longer term it's better to risk a visible deadlock than risk silent bad latency.

On Wed, 2004-11-24 at 23:42 +0100, andrea@cpushare.com wrote:
So basically you write a byte into the pipe from the signal, so poll will return, right?
Yeah.
1sec latency for a signal would been pretty huge anyway btw ;), so I guess for the longer term it's better to risk a visible deadlock than risk silent bad latency.
That's one way to look at it, yes :)
participants (3)
-
andrea@cpushare.com
-
Itamar Shtull-Trauring
-
James Y Knight