Charles-François Natali added the comment: > 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20320> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com