Message209760
> 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. |
|
Date |
User |
Action |
Args |
2014-01-31 10:36:31 | neologix | set | recipients:
+ neologix, gvanrossum, vstinner, python-dev |
2014-01-31 10:36:31 | neologix | set | messageid: <1391164591.3.0.530227157249.issue20452@psf.upfronthosting.co.za> |
2014-01-31 10:36:31 | neologix | link | issue20452 messages |
2014-01-31 10:36:30 | neologix | create | |
|