[Python-bugs-list] [ python-Bugs-435596 ] Fork/Thread problems on FreeBSD
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 22 Jun 2001 15:29:48 -0700
Bugs item #435596, was opened at 2001-06-22 15:29
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435596&group_id=5470
Category: Threads
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fork/Thread problems on FreeBSD
Initial Comment:
Run this code on both Linux and FreeBSD. On Linux you
get a continuous stream of *'s. On FreeBSD you get 1.
FreeBSD is wrong.
import thread, os, sys, time
def run():
while 1:
if os.fork() == 0:
time.sleep(0.001)
sys.stderr.write('*')
sys.stderr.flush()
sys.exit(0)
break
os.wait()
thread.start_new_thread(run, ())
while 1:
time.sleep(0.001)
pass
I ran into this problem when trying to use Popen3 to
run a system call from Zope. The fork in Popen3 never
gets to the execvp. It works fine on Linux. I believe
the problem in the above code is caused by the same
issue.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435596&group_id=5470