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-02-11.09:55:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1392112558.1.0.467327559937.issue20320@psf.upfronthosting.co.za>
In-reply-to
Content
> 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)...

After many many tests with asyncio (last issue: #20505), I disagree with you. It has a real impact.

Can someone please review my new patch?

I now think that select.select() should also be fixed in Python 3.4 to be consistent with the new select.poll() and select.epoll.poll() behaviour (timeout rounding).

See msg210914 and msg210915 ( http://bugs.python.org/issue20505#msg210914 ): IocpSelector sleeps at least 0.5 ms (of perf counter) even with a timeout of 1 nanosecond, whereas SelectSelector sleeps sometimes 0.030 ms which looks like a non-blocking call.

I tested asyncio with the patch to round select timeout away from zero:

* With HPET disabled, SelectSelector sleeps at least 15 ms according to the monotonic clock (FYI: at least 2 ms according to the perfomance counter)

* With HPET enabled, SelectSelector sleeps at least 15 ms according to the monotonic clock (FYI: at least 6.3 ms according to the perfomance counter)

These results are the expected behaviour: selectors should at least one unit of the monotonic time (15.6 ms).
History
Date User Action Args
2014-02-11 09:55:58vstinnersetrecipients: + vstinner, belopolsky, pitrou, skrah, neologix, serhiy.storchaka
2014-02-11 09:55:58vstinnersetmessageid: <1392112558.1.0.467327559937.issue20320@psf.upfronthosting.co.za>
2014-02-11 09:55:58vstinnerlinkissue20320 messages
2014-02-11 09:55:57vstinnercreate