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

hi all - having the unfortunate need to program a socket server under activestate/win32 and need a way arround the 64 process limit (ie. can't fork: resource temporarily unavailable) any quick fixes? i've looked in the archives, and am trying a Win32::Process work around, but would loveit if someone had a better solution. thanks!

Replies are listed 'Best First'.
Re: win32 fork 64 process limit
by Errto (Vicar) on Jan 08, 2005 at 03:20 UTC
    According to Re: IO::Select on Windows, the module IO::Select works on Win32. Therefore you can use this to implement a socket server without forking. It may require some substantial changes to your code, but hopefully you'll be happier in the end. See the docs for a basic example of how to read from multiple sockets at once using this module.
Re: win32 fork 64 process limit
by ambrus (Abbot) on Jan 08, 2005 at 13:58 UTC

    I don't know of any quick fix (I suppose installing a new os instead of win32 isn't possible). I can only agree with the others: write a single-threaded program with select (or poll or epoll).

    (If you insist on a multi-threaded program, you'll have to use a program with a more lightweight thread modell, as you'll need many threads. Try ruby, bigloo scheme, python, or (and I hate to say this) java.)

Re: win32 fork 64 process limit
by wolfger (Deacon) on Jan 08, 2005 at 13:43 UTC

    64 process limit? Fork on win32 gives me problems way before I hit 64... At any rate, this node may be what you need. I never implemented it myself, since I found a different solution to my problem, but it could be the answer for you.


    --
    Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0
    perl -e 'print(map(chr,(0x4a,0x41,0x50,0x48,0xa)))'