[pypy-issue] [issue1323] subprocess.call, threading.Thread and OS X does not complete

Kenny Levinsen tracker at bugs.pypy.org
Tue Nov 13 21:53:35 CET 2012

Kenny Levinsen <kennylevinsen at gmail.com> added the comment:

I have traced it to os.fork() and threads, instead of subprocess.call()/Popen.

I have attached a simple example that - in CPython - prints "Child" 30 times.
In PyPy, however, it only works every 5th run or so, and I have never seen it 
print "Child" more than twice, despite forking 30 processes.
It works fine if you call the test function directly, instead of using Thread()

The funny thing is, that after a while, you'll be unable to fork. Why? PyPy's 
os.fork() DOES fork. It just doesn't appear to do anything beyond that - the 
processes just hangs there... And for 30 forks per run, you'll have a lot of 
processes very fast. :)

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list