Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Fork() Function

by zentara (Archbishop)
on May 13, 2014 at 14:50 UTC ( #1085913=note: print w/ replies, xml ) Need Help??


in reply to Fork() Function

In addition to the good advice given above, I would like to point out 1 little pitfall which you may encounter. When forking you often get the pid of the shell process invoked which then actually spawns another pid to run your program. So be aware that the pid reported back by fork, will probably be a shell's pid. The shell then has a child, which is your actual program. See Proc://KillFam for a way to kill the entire process tree which results from your fork.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: Fork() Function
Re^2: Fork() Function
by sundialsvc4 (Abbot) on May 13, 2014 at 22:43 UTC

    Heh ... “a little battle-won insight” that is well deserving of the many up-votes that it is now happily accumulating!   :-D   Too-bad I could only praise it once.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2014-10-25 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (138 votes), past polls