Grrr,

I was raised in a Sys V /Linux environment and in my perl programs that are
multithreaded I have been using:

    SIG{CHLD} = 'IGNORE' ;

To deal with the problem of zombies.

Much to my chagrin, yesterday I found out that Darwin/MacOS X does not work
that way. I found out via a simple proxy http server that I had written a
long time ago. It started out fine and then suddenly I could not execute any
more commands. ( fork, resource temporarily unavailable). The only way I
could get control again was to quit terminal. After a bit of pondering I
started watching via ps as the proxy server would receive requests, sure
enough the dead children where not being buried :) After a complex page was
loaded the process table was littered with dead children.

The solution was to use a signal handler for the Death of Child signal that
basically calls waitpid(-1,WNOHANG) in a loop until no more children can be
harvested. This seems to work on my MacOS X and Linux systems.

I have re uploaded my perl httpd server, it had the same problem. The proxy
server is still acting a bit weird, I am afraid that web pages are becoming
more complex than my simple program can handle.

I also uploaded my "humpf" program. This program provides a simple framework
for developing menu driven perl applications. It was written for perl 4! but
appears to work fine with my linux and macos x systems. One caveat, the
program assumes a "terminfo" capability, this can be obtained by installing
the NCURSES subsystem. Using the native macos x "tput" program will not
work. I could not get the rascal to work at all until I modified the search
path in the program so it would find the ncurses tput before the mac os
version.

My perl stuff is located at:  http://homepage.mac.com/levanj

Enjoy

--Jerry

Reply via email to