http://www.perlmonks.org?node_id=19954

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

For a small (ultra efficent) web server spawning new sockets and transfering the connection to the new socket (child): you need fork to do that, but is there a way to do it without?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: Is fork() supported in win98?
by davorg (Chancellor) on Jun 27, 2000 at 09:59 UTC

    The latest builds of ActivePerl (the 5.6 series) now support fork on Win98

Re: Is fork() supported in win98?
by Corion (Patriarch) on Jun 27, 2000 at 11:05 UTC

    While we are talking about efficiency, fork() is really not the speed efficient way under Win32, as fork() is not a native OS feature. fork()ing under Win32 currently means that the whole process space is copied, at least all data has to be copied into the forked child.

    Personally, I found besides the performance issues also some weird behaviour with sockets when using fork(), but that may have been due to using Windows 98, strange Perl code or the phase of the moon.

Re: Is fork() supported in win98?
by Shendal (Hermit) on Jun 27, 2000 at 18:26 UTC
    I have played around with fork on WinNT. It is advertised as a beta feature, and I strongly suggest that you take them at their word. While programming my chatterbox client, I initially tried this new fork() feature, but it wouldn't work for anything but the simplest forks. I couldn't isolate the problem, but I suspect that it is related to certain modules not being "fork" compatible, or perhaps socket problems such as Corion had described above.

    All in all, I'd suggest not using this for production work and look at it as a curiosity. Hopefully, features such as fork (and alarm!) will be fully (and reliably) implemented.
Re: Is fork() supported in win98?
by Anonymous Monk on Feb 01, 2004 at 09:01 UTC

    Re: Is fork() supported in win98?

    Originally posted as a Categorized Answer.