Forking and Threads

Paul Robinson paul.robinson at businesscollaborator.com
Fri Feb 9 04:26:06 EST 2001


David Bolen wrote:
> 
> 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?

Normal upto the the CPU burn and then nothing.

> 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).

Yes, I agree. The original case I was working on (in the larger program)
was instrumented more heavily and I came to the conclusion that it was
getting stuck at a random point! There were sockets and select involved
with that as well so it was slightly more complicated. 90% of the time
it would crash while doing the select - but I guess that was just
because 90% of the program time was spent doing the select!
 
> 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?

The value of CHILD is just there in case children are spawning children
(they were in previous versions...)

It ran successfully overnight using Python 2.0!

Paul Robinson
Business Collaborator Development Manager
Enviros Software Solutions
WWW: http://www.businesscollaborator.com




More information about the Python-list mailing list