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 gvanrossum, neologix, python-dev, vstinner
Date 2014-01-31.10:36:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391164591.3.0.530227157249.issue20452@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2014-01-31 10:36:31neologixsetrecipients: + neologix, gvanrossum, vstinner, python-dev
2014-01-31 10:36:31neologixsetmessageid: <1391164591.3.0.530227157249.issue20452@psf.upfronthosting.co.za>
2014-01-31 10:36:31neologixlinkissue20452 messages
2014-01-31 10:36:30neologixcreate