This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients belopolsky, neologix, pitrou, serhiy.storchaka, skrah, vstinner
Date 2014-01-21.10:40:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390300809.44.0.873320334506.issue20320@psf.upfronthosting.co.za>
In-reply-to
Content
Timings on my laptop:

>>> import time, select
>>> t0=time.perf_counter(); select.select([], [], [], 1e-6); dt=time.perf_counter()-t0; dt
([], [], [])
0.00012494399561546743
>>> t0=time.perf_counter(); select.select([], [], [], 0); dt=time.perf_counter()-t0; dt
([], [], [])
4.965400148648769e-05

A call to select.select() with a timeout of 1 microsecond (10^-6) takes 124 microesconds.

A non-blocking call to select.select() (timeout of 0 microsecond) takes 50 microseconds.

> Just so it's clear, those bugs are theoretical: whether you pass 1e-7/1e-10 or 0 to select/kqueue is exactly the same (entering/leaving the syscall takes some time)...

Yes, the problem of asyncio (explained in issue #20311) is that selector.select(timeout) took *less* than timeout seconds even when no new event was found, and so the loop restarted again and again.

According to the timings above, selector.select(1e-7) (which calls currently select.select() in non blocking mode, with a timeout of 0 second) takes longer than 1e-7 second: at least 500e-7 seconds. So yes, the problem cannot be reproduced on my current hardware.

It may be fine to only fix these bugs in Python 3.5.
History
Date User Action Args
2014-01-21 10:40:09vstinnersetrecipients: + vstinner, belopolsky, pitrou, skrah, neologix, serhiy.storchaka
2014-01-21 10:40:09vstinnersetmessageid: <1390300809.44.0.873320334506.issue20320@psf.upfronthosting.co.za>
2014-01-21 10:40:09vstinnerlinkissue20320 messages
2014-01-21 10:40:09vstinnercreate