[Python-Dev] Who can make test_fork1 fail?

Charles G Waldman cgw@fnal.gov
Sat, 19 Aug 2000 00:26:33 -0500 (CDT)


Tim Peters writes:

 > Since nobody has made real progress on figuring out why test_fork1 
 > fails on some systems,  would somebody who is able to make it fail
 > please just try this patch & see what happens?

Or try this program (based on Neil's example), which will fail almost
immediately unless you apply my patch:


import thread
import os, sys
import time

def doit(name):
    while 1:
        if os.fork()==0:
            print name, 'forked', os.getpid()
            os._exit(0)
        r = os.wait()

for x in range(50):
    name = 't%s'%x
    print 'starting', name
    thread.start_new_thread(doit, (name,))

time.sleep(300)