Re: for a background process and return

[prev] [thread] [next] [Date index for 2005/04/30]

From: Stas Bekman
Subject: Re: for a background process and return
Date: 15:56 on 30 Apr 2005
jiesheng zhang wrote:
> Hi
> I am try to run something like this in my cgi.
> -------------------------------------
> system ("sleep 3000 &");
> -----------------------------------
> Since, it is time-consuming task, I let it run in background and 
> immediately return to user. I tested this script. It was no problem for 
> a standalone perl script. However, once I had this script in a perl cgi. 
> The script seemed  not to have this system command run in background. It 
> waited there for the child process to finish.
> Any clue for why it behaved like that? How can I for a child process in 
> background and return immediately to the web user?
> 
> Help is really appreciated!

jiesheng, please take a look at:
http://perl.apache.org/docs/1.0/guide/performance.html#Forking_and_Executing_Subprocesses_from_mod_perl
it explains how to do this sort of things.

        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

for a background process and return
jiesheng zhang 15:56 on 29 Apr 2005

Re: for a background process and return
Stas Bekman 15:56 on 30 Apr 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52