[Python-Dev] PEP 492: What is the real goal?
Jim J. Jewett
jimjjewett at gmail.com
Fri May 1 23:23:57 CEST 2015
On Fri, May 1, 2015 at 4:10 PM, Guido van Rossum <guido at python.org> wrote:
> On Fri, May 1, 2015 at 12:48 PM, Jim J. Jewett <jimjjewett at gmail.com> wrote:
>> If there are more tasks than executors, yield is a way to release your
>> current executor and go to the back of the line. I'm pretty sure I
>> saw several examples of that style back when coroutines were first
> Could you dig up the actual references? It seems rather odd to me to mix
> coroutines and threads this way.
I can try in a few days, but the primary case (and perhaps the only
one with running code) was for n_executors=1. They assumed there
would only be a single thread, or at least only one that was really
important to the event loop -- the pattern was often described as an
alternative to relying on threads.
FWIW, Ron Adam's "yielding" in
in the same spirit.
You replied it would be better if that were done by calling some
method on the scheduling loop, but that isn't any more standard, and
the yielding function is simple enough that it will be reinvented.
More information about the Python-Dev