Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How do you wait for a process to end ?

by claree0 (Hermit)
on Aug 23, 2001 at 18:33 UTC ( [id://107339]=note: print w/replies, xml ) Need Help??


in reply to How do you wait for a process to end ?

I think that you need to set up a signal handler for your children exiting -

$SIG{CHLD} = \&some_subroutine;
which will allow you to deal with the children as they die.

Replies are listed 'Best First'.
Re (tilly) 2: How do you wait for a process to end ?
by tilly (Archbishop) on Aug 24, 2001 at 07:49 UTC
    Perl does not have reliable signal handling. If it is for production use and has to work day in, day out for an extended time, I would suggest avoiding signal handlers.
      Interesting... I have never heard that, nor had that problem. Is it that way on all *nixes, or just on OSes with weird/broken signals?
        The problem is with Perl itself.

        IIRC there are two problems. The first is that if you receive a signal from within a signal handler, you are likely to dump core. The second is that if Perl allocates memory within a signal handler (which it might do for a lot of reaons), you are likely to dump core. The result is that if you are using signal handlers, doing complex things in your handlers, and receiving a large number of signals, you are aperiodically going to dump core.

        But note that I have heard rumor that Perl 5.8 is likely to fix this. (The problem with learning about the bugs is that they keep on going away...grumble...:-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://107339]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-24 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found