I've found the bug http://bugs.python.org/issue1731717.
It seems wating subprocess can be multithreaded but creating
subprocess cannot.
On Oct 12, 9:57 am, INADA Naoki wrote:
> On Oct 12, 5:33 am, Jed Smith wrote:
>
> > On Mon, Oct 11, 2010 at 4:19 PM, INADA Naoki wrote:
> > > def worker():
> >
On Oct 12, 5:33 am, Jed Smith wrote:
> On Mon, Oct 11, 2010 at 4:19 PM, INADA Naoki 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 work
On Mon, Oct 11, 2010 at 4:19 PM, INADA Naoki 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?
On Ubuntu 10.10 amd64 and dual-core CPU, following code deadlocks.
What's wrong on this code?
#http://codepad.org/GkoXHbik
#!/usr/bin/env python
from subprocess import *
from threading import *
THREAD_COUNT=50
def worker():
p = Popen(["cat"], stdin=PIPE, stdout=PIPE, stderr=STDOUT)
out