On Wed, Oct 22, 2008 at 5:44 PM, Ertl, John C CIV 63134 <[EMAIL PROTECTED]> wrote: > Classification: UNCLASSIFIED > Caveat (s): FOUO
?? > Thanks for the help and I am looking into the pyprocessing but threading is > causing too many headaches (I may have to rewrite things). Lets say I have > something as simple as below: > > def takeTime(a): > print "Started %s" % a > time.sleep(10) > print "Ended %s" % a > > for each in [1,2,3,4,5]: > pid = os.fork() > takeTime(each) > > Each time the function is called it waits 10 seconds. And if I run it as > above it does the first and waits 10 seconds then the second and waits ten > seconds...etc. You are calling takeTime() from both the parent and child process, and you are spawning additional processes from the child process as well. Try if os.fork(): takeTime(each) break Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor