[Python-bugs-list] [ python-Bugs-435596 ] Fork/Thread problems on FreeBSD

noreply@sourceforge.net noreply@sourceforge.net
Sat, 23 Jun 2001 14:02:31 -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.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2001-06-23 14:02

Message:
Logged In: YES 
user_id=21627

Why do you think this is a bug in Python?

Can you determine whether the thread is started, and 
whether the fork returns for the parent?


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=435596&group_id=5470