[Python-ideas] Tulip / PEP 3156 - subprocess events

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 22 05:13:50 CET 2013


Guido van Rossum wrote:
> And in this case it doesn't seem easy to use the StreamReader class,
> since you can't know which of the two (stdout or stderr) will have
> data available first, and guessing wrong might cause a deadlock.

I don't see the problem. You run two Tasks, one handling
stdin/stdout and one handling stderr. (Or three tasks if
stdin and stdout are not synchronised.) Seems like an ideal
use case for coroutines to me.

-- 
Greg



More information about the Python-ideas mailing list