> The task would take a long time to complete. So I use fork() to create child
>processes to run a subrountine code,
> hoping they would run on background and the parent CGI would return the request and
>close the connection.
> However, I found that even the parent end, the CGI connect still keep alive.
The child process needs to close any files it inheritted from
the parent - especially STDIN, STDOUT and STDERR. If these are
needed, the child should arranged for its output to go to a
file and should quickly read any input, then close STDIN.