<?xml version="1.0" encoding="windows-1252"?>
<node id="1002489" title="Re: Forking in CGI scripts" created="2012-11-06 09:42:09" updated="2012-11-06 09:42:09">
<type id="11">
note</type>
<author id="647953">
sundialsvc4</author>
<data>
<field name="doctext">
&lt;p&gt;
Also, if the work to be done is &amp;ldquo;substantial,&amp;rdquo; you might not want to implement it &lt;em&gt;in&lt;/em&gt; the CGI script at all, for various reasons. &amp;nbsp; Instead, you might conceive of the CGI script strictly as a user-interface, in which you can queue work-requests (say, they're written to a database table), observe the completion status of requests you've queued, and retrieve the results selectively. &amp;nbsp; Meanwhile, a back-end processor or processors, say written in Perl, poll this queue and carry out the work. &amp;nbsp; (They put the results in a directory that&amp;rsquo;s mutually accessible and note in the database where they put it.) &amp;nbsp; Now, the CGI system is back to doing what it customarily does: &amp;nbsp; handling very brief, &amp;ldquo;get in then get out in a few milliseconds&amp;rdquo; requests. &amp;nbsp; The worker-bee daemons can be anywhere. &amp;nbsp; And results, once generated, can be viewed more than one time at will. &amp;nbsp; How you devise the daemons to work, &lt;i.e.&lt;/i&gt; forking or not,  is entirely up to you and no longer of any concern to CGI.
&lt;/p&gt;</field>
<field name="root_node">
1002431</field>
<field name="parent_node">
1002431</field>
</data>
</node>
