I think the first commenter is on track here. You may, but not necesarily, run into problems fork'ing a process from a CGI script which is run by the web server user. Depends on the web server setup and could open you up to some security risks. The best idea for processing requests that don't have to happen in realtime after the user submits is to store those requests somewhere and have another program process them at regular intervals.

I'm not sure what sort of requests you're processing, but you could put them in a flat file database in some directory and have another program run from cron at regular intervals that processes those requests and removes them from the flat file. The only issue you'd have to deal with in this situation is contention for the file resource when the CGI program is "writing" to the flat file at the same time the cron'd process wants to read from it. But you can use file locking to handle this, as it shouldn't take long to process simple requests from a text file.

If you can give us some more details about what sort of processing is going on there might be other solutions, too.

---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'


In reply to Re: Fork() and exec() by tuxz0r
in thread Fork() and exec() by axl163

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.