in reply to Managing a long running server side process using CGI
I don't know how the Windows folks spawn their child processes, but in *nix, it's fork. For example:
my $pid = fork(); if ( ! defined $pid ) { die "Can't fork: $!\n"; } if ( $pid ) { # parent } else { # child }
You could also look at Proc::Daemon which has this and more wrapped up in a tidy package.
Using a file to do your communication is a fine idea. To avoid polling, you could also use signals to let the worker know when to look. Have a look at the "Signals" section of perlipc.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Managing a long running server side process using CGI
by xdg (Monsignor) on Jan 27, 2007 at 16:25 UTC |