>>>>> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes:

  NI> Bart Lateur <[EMAIL PROTECTED]> writes:
  >> 
  >> Apropos safe signals, isn't it possible to let perl6 handle avoiding
  >> zombie processes internally? What use does having to do wait() yourself,
  >> have anyway?

  NI> Valid point - perl could have a CHLD handler in C and stash away returned
  NI> status to pass to wait() when it did get called.

there are plenty of reasons to handle SIGCHLD yourself. first, you could
be watching the process and need to know if it dies. if perl handles it
for you then you need another way to be notified of a process
death. secondly, SIGCHLD doesn't ncessarily mean a process died, but
that its status has changed. this could come from a SIGSTP which will
pasue the child process and let the parent know. i think debugging a
child will also generate SIGCHLD when the child is breakpointed.

so having perl do the reaping is only good if you set some option like:

        $SIG{ CHLD } = 'AUTOREAP' ;

that could be a default if you use the event loop. then some code that
needs to handle SIGCHLD directly could also do that by setting their own
handler.

NOTE: i am for a change of syntax away from %SIG. an object interface
would allow more flexibility and code consistancy with other
callbacks. see rfc 60 for more.

uri

-- 
Uri Guttman  ---------  [EMAIL PROTECTED]  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com

Reply via email to