Python deadlocks when Popen in multithread.

Jed Smith jed at jedsmith.org
Mon Oct 11 22:33:23 CEST 2010


On Mon, Oct 11, 2010 at 4:19 PM, INADA Naoki <songofacandy at gmail.com> wrote:

> def worker():
>    p = Popen(["cat"], stdin=PIPE, stdout=PIPE, stderr=STDOUT)
>    out = p.communicate("hoge")[0]
>    print "%s %s" % (current_thread().name, out)

If, instead of spawning workers you directly call worker(), does it succeed?

I suspect the threading is a red herring here.

-- 
Jed Smith
jed at jedsmith.org



More information about the Python-list mailing list