[kw-pm] Fork / Independent child process

Robert Pike roberthpike at yahoo.com
Wed Dec 27 07:33:53 PST 2017


It's been awhile since I've asked a question on here, mainly because I've been using other languages since, but here goes. I have a CGI application that accepts selection criteria from a user that is then used to select data from a MySQL database and generate reports. 
Some of these reports can take some time to run so when the main CGI script is called I want to spawn off a call to a script that does the data selection and report generation. I've tried the following and it appears that the child is called fine but the parent script still waits for it (child process) to finish.
#*** $parmList is just a list of name-value pairingsif ($pid = fork) {} else {      close (STDOUT);      exec ($parmSetup{"directory"}{"intExecPath"}."XMLStandAlone.exe ".$parmList);}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/kw-pm/attachments/20171227/8580fdd1/attachment.html>


More information about the kw-pm mailing list