[kw-pm] Fork / Independent child process

Justin W kw-pm at datademons.com
Wed Dec 27 20:21:17 PST 2017


Close STDERR in the child too -- your browser is hanging around waiting for
that filehandle to eof too.

Justin

On Wed, 27 Dec 2017 15:33:53 +0000 (UTC) Robert Pike <roberthpike at yahoo.com>
wrote:

> 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);}
> 


More information about the kw-pm mailing list