in reply to Forking in a CGI program on Windows systems

From my C days, I understand fork to be a *nix-only command - in fact the Camel (2nd edition) says "The fork function is unlikely to be implemented on any OS not resembling UNIX."

Win32::Job might do what you need - it'll let you "spawn" a process on Windows, and it's docs contain a couple of good examples.

Hope that helps ..
--Foxcub

Replies are listed 'Best First'.
Re: Re: Forking in a CGI program on Windows systems
by relax99 (Monk) on Nov 08, 2002 at 16:45 UTC

    Well, you're right of course. But when I used the term "forking", I refered to the general idea, not a particular implementation on a particular system.

    Since you quoted the Camel Book (3rd edition), it then says "...The fork function is unlikely to be implemented efficiently, or perhaps at all, on systems that don't resemble Unix. For example, Perl 5.6 emulates a proper form even on Microsoft systems... ". And, in fact, fork does work on my Windows. I tested it, it works. My question was related to using fork from a CGI program. My problem seems to be that the web server does not output the web page until all shared filehandles are closed or something alone these lines - if I knew exactly what's going and how to fix it I wouldn't be asking that question.

    Win32::Job is *almost* the same (in its functionality) as Win32::Process. As I have mentioned in my post, I would like the spawned process to have access to the shared information, so that it can just simply save it to file. If I used Win32::Process or Win32::Job, it seems to me that I would have to use a pipe or at least command line arguments to transfer the parameters from the CGI program to the spawned process.