I have used fork() and INET sockets successfully on Windows, although I've never used more than 2 or 3 processes. I tried your program on ActivePerl 5.8 on Windows 2000 and it ran fine. I've been using Windows 2000 at work for a couple of years now and Windows XP at home. Back when I was running 95/98/ME, I had a lot more problems.

You should consider upgrading to 5.8. You can also try running Perl under Cygwin (it's a free Unix-like environment for Windows based on the GNU tools). Cygwin runs great on Windows 2000 and XP. Once again, it's more problematic with 95/98/ME. It is much more compatible with Unix than Activeperl. You can have both Activeperl and Cygwin Perl installed at the same time--they go in separate directories. The fork emulation is much better--it's still slow compared to Unix, but fast enough for many uses.

You could also use Win32::Process instead of fork() to start up brand new processes. You would pass a command-line argument telling the program that it is a child (and possibly giving a socket port to connect to).

You can try debugging Net::Shared--just put a bunch of print statements in the modules and see exactly where it fails--you might be able to fix it, even without upgrading your Perl. The module files should be installed as:
c:\Perl\site\lib\Net\Shared.pm
c:\Perl\site\lib\Net\Shared\Handler.pm
c:\Perl\site\lib\Net\Shared\Local.pm
c:\Perl\site\lib\Net\Shared\Remote.pm
Specifically, sub store is in Handler.pm and it calls a couple of subs in Local.pm.

One other piece of advice is that you probably don't want to try to max out the number of processes that you are running. If you spend most of your time waiting for a response over the network, then maybe 10 to 15, but that may be pushing it. Your network connection bandwidth, CPU, and memory will probably limit you before that.


In reply to Re: Useful fork with IPC on win32 ? by Thelonius
in thread Useful fork with IPC on win32 ? by NetWallah

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.