[Python-ideas] The async API of the future: yield-from
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Oct 15 08:04:16 CEST 2012
Ben Darnell wrote:
The problem is that as soon as task1 blocks on IO, the entire
> current task (which includes outer(), par(), and both children) gets
> unscheduled. no part of task2 gets scheduled until it gets yielded
> from, because the scheduler can't see it until then.
The suggested implementation of par() that I posted does
explicitly schedule the subtasks. Then it repeatedly
yields, giving them a chance to run, until they all
complete.
--
Greg
More information about the Python-ideas
mailing list