Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Update on controlling long-running processes via CGI

by brachtmax (Initiate)
on Nov 13, 2014 at 10:44 UTC ( [id://1107087]=note: print w/replies, xml ) Need Help??


in reply to Update on controlling long-running processes via CGI

regarding the creation of a a child process,- fork() for itself creates just a clone of the current process, it's useless without a subsequent exec(). So after the fork() you have two (almost) identical processes, both of'em just returning from fork(). The fork return value is then used to determine whether it's child or parent - in case of parent you do the exec() then which replaces the clone with whatever process you like: if($pid = fork()) { #...this is the parent ... } elsif (defined $pid) { # this is the child... exec(<whatever executable>) } else { # error - the fork() didn't work }
  • Comment on Re: Update on controlling long-running processes via CGI

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found