[Python-ideas] Tulip / PEP 3156 event loop implementation question: CPU vs. I/O starvation
Nick Coghlan
ncoghlan at gmail.com
Sat Jan 12 04:08:14 CET 2013
On Sat, Jan 12, 2013 at 9:41 AM, Guido van Rossum <guido at python.org> wrote:
> So what's more important? Avoid I/O starvation at all cost or make the
> callbacks-posting-callbacks pattern efficient? I can see several
> outcomes of this discussion: we could end up deciding that one or the
> other strategy is always best; we could also leave it up to the
> implementation (but then I still would want guidance for what to do in
> Tulip); we could even decide this is so important that the user needs
> to be able to control the policy here (though I hate having many
> configuration options, since in practice few people bother to take
> control, and you might as well have hard-coded the default...).
>
> Thoughts? Do I need to explain it better?
Given the availability of "yield from" as a tool for efficiently
invoking other asynchronous operations without hitting the event loop
at all, it seems to me that it is more appropriate to avoid IO
starvation by interleaving IO event processing and ready callback
processing.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list