I have been asked by a friend to convert a command line application to have a web interface. As this is the first CGI programming I have done I've taken Ovid's excellent introductory cgi_course and now know all there is to know about CGI a little about CGI and security.

While the web interface is fairly simple - gather a few parameters then kick off a simple process - the process comprises running a very large number of iterations of a simple calculation then generate some statistical results. My problem is: how do I set up a CGI process to do some work that may take between a few hours and a day while letting the user who initiated the process monitor progress and possibly even update parameters and restart the process?

My initial thought is that this could be accomplished by using a file to pass information to a "child" process which performs the actual processing, updating a status file as it goes. Questions are: how do I spawn a child process (for a Windows or *nix server) and is there a better mechanism for interprocess communication than simply using a file?


DWIM is Perl's answer to Gödel

In reply to Managing a long running server side process using CGI by GrandFather

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.