Forking and Threads

David Bolen db3l at fitlinxx.com
Thu Feb 8 17:45:22 EST 2001


Paul Robinson <paul.robinson at businesscollaborator.com> writes:

> Update:
> My last run ( forkingtest2.py -MC 50 -MS 3 ) ran for 24 minutes before
> running at a steady 99% CPU!

What do you see in your log file leading up to the hang?  Does there
seem to be continued logging during the CPU burn or is it quiet?  I'd
probably try to figure out just what portion of the code the main
process was in while burning CPU (it sort of looks like it could
really only be in your waitpid loop, but a few additional log messages
might be useful).

Also, you might try exiting the child process more nicely (e.g., with
a sys.exit rather than os._exit) in case it's a question of resource
cleanup of some sort.

BTW, I can't actually run it here (Windows) but do you ever see a log
message from a child other than "1" - it looks like you only increment
CHILD inside the child process itself, so wouldn't all the children
get a value of 1?

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list