Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1085913]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2018-06-22 06:34 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (122 votes). Check out past polls.