Hi all, Xicheng Jia wrote: > On 12/11/07, Alfie John <[EMAIL PROTECTED]> wrote: > >> >> I really don't see a problem with backticking + backgrounding if >> that's the functionality you need. It is bad to fork regardless on the >> way you achieve it within mod_perl since you take a performance hit >> for duplicating the apache parent. However if speed is not a problem, >> then backticks + backgrounding is your easiest option. >> >> If speed *is* a problem, then that link above to the mod_perl docs has >> good examples on what to do. >> >> If anybody can see a problem with the above, speak up or forever hold >> your peace :) >> > > There are several problems when using 'backtick' here: > 1) From my tests, be it a background or foreground command within > backticks, your process has to wait for it to finish to continue. A > simple Mason file can address this problem: > > <% rand() %> > <%init> > `sleep 20 &`; > </%init> > > and see how long it takes to render your webpage. > > My point: if the external program takes some non-trivial time to > finish, qx// and the likes are not the ways OP might need. >
Thank you both for an interesting discussion, especially since it isn't Mason-related. I was using "system" instead backticks with an ampersand at the end (&), and the web page did render immediately. It is true that the external program will take some non-trivial time to run and because of this, I want the page to show up immediately during the processing for the user to do something else. But, I don't really want to make a copy of the apache2 process but I think I need to try both the simple and complex methods to find out how much overhead is being added. Thanks again! Ray ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users