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 neologix
Recipients belopolsky, neologix, pitrou, serhiy.storchaka, skrah, vstinner
Date 2014-02-11.11:23:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM2ybSY9zO_N8VyXNV9xOhy+4UKNo5tAYxwhNxmYJy010g@mail.gmail.com>
In-reply-to <1392112558.1.0.467327559937.issue20320@psf.upfronthosting.co.za>
Content
> STINNER Victor added the comment:
>
>> 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.

And I stand by my claim. Quoting your test results:
"""
asyncio: IocpProactor.select(10.0000 ms) took 9.486 ms
(monotonic=0.000 ms, clock res=15.600 ms)
asyncio: IocpProactor.select(0.0010 ms) took 0.942 ms (monotonic=0.000
ms, clock  res=15.600 ms)
asyncio: IocpProactor.select(0.0000 ms) took 0.553 ms (monotonic=0.000
ms, clock res=15.600 ms)
asyncio: IocpProactor.select(0.0000 ms) took 0.517 ms (monotonic=0.000
ms, clock res=15.600 ms)

asyncio: SelectSelector.select(0.1000 ms) took 2.276 ms
(monotonic=0.000 ms, clock res=15.600 ms)
asyncio: SelectSelector.select(1.0000 us) took 30.810 us
(monotonic=0.000 us, clock res=15600.100 us)
asyncio: SelectSelector.select(0.0100 us) took 30.350 us
(monotonic=0.000 us, clock res=15600.100 us)
asyncio: SelectSelector.select(0.0001 us) took 28.930 us
(monotonic=0.000 us, clock res=15600.100 us)
"""

As one can see, when passed a timeout lower than the resolution, e.g.
0.01 usec, select() takes around 30usec, *which is above the timeout*
(0.01usec), which is exactly what I claimed.

> These results are the expected behaviour: selectors should at least one unit of the monotonic time (15.6 ms).

That's just wrong.
The expected bahavior is that selector.select() should wait at least
the *timeout passed*, not the "unit of monotonic time" (which doesn't
mean anything by the way).

Now, rounding away from zero for select/kqueue is fine to me, just to
be consistent.
History
Date User Action Args
2014-02-11 11:23:05neologixsetrecipients: + neologix, belopolsky, pitrou, vstinner, skrah, serhiy.storchaka
2014-02-11 11:23:05neologixlinkissue20320 messages
2014-02-11 11:23:05neologixcreate