Charles-François Natali added the comment:
> It looks like select() and poll() in Linux < 2.6.28 has a resolution
> of 1/HZ, where HZ can be retrieved from os.sysconf('SC_CLK_TCK'). Since
> Linux 2.6.28, hrtimers are now used for timeouts.
> Attached patch improves the resolution field of selectors.BaseSelector.
> By the way, resolution should be a method (selector.resolution())
> rather than a property, because we may query the kernel to compute the
> resolution, as shown in the patch.
That's exactly why I said that an explicit resolution is a bad idea:
- it's an implementation detail
- it's fragile (just look at your latest patch)
- it's useless
Just round the timeout away from 0 and be happy: this will fix the busy-wait
problem, and that's all we want.
Once again, I know I keep repeating myself, but having select/epoll/whatever
wake up 10usec before the timeout isn't an issue: *all* async-IO frameworks out
there work just fine with this.
So please, revert all this granuarity complexity, and re-apply the timeout
rounding.
----------
nosy: +neologix
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20452>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com