Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
XP is just a number
 
PerlMonks  

(MeowChow) Re: 65 is the magic number!

by MeowChow (Vicar)
on May 14, 2002 at 04:01 UTC ( #166363=note: print w/ replies, xml ) Need Help??


in reply to 65 is the magic number!

65 is indeed the magic number, because you're hitting the limit on per-process file descriptors for Win32 (I'm guessing 98 / ME, correct?). If you run on Win NT/2000/XP, the max goes up to 255.

I'm unsure if there's a way to increase your 98/ME fdmax, perhaps you can try setting FILES=255 in your config.sys.

   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on (MeowChow) Re: 65 is the magic number!
Re: (MeowChow) Re: 65 is the magic number!
by Declarent (Sexton) on May 14, 2002 at 04:11 UTC

    I am running 2000, but the file descriptor max idea is interesting. I'm actually wanting to get rid of the fd's after I get rid of the child process, but I can't seem to make them go away unless I close the server.

    Even at 255, I'll crap out at some point unless I can get rid of them when I exit the child.

    Any ideas on how to nuke em?

    D

      Forking under Win32 is emulated; a child process is not actually created. That's probably why the fd's are not going away. See perlfork.
         MeowChow                                   
                     s aamecha.s a..a\u$&owag.print

        True, it's really just ithreads. So, that being the case is there no way to drop an FD once you're done with it? Since the server is running in the primary thread, is the only way to drop all those handles to drop the server? Ack.

        I'd also be happy to use spawn or process::create, but those seem to only work on external executables and not something inside the original code.

        If I only had the option of running on my AIX box, I'd be a happy camper, but this is win32 only.

        D

        Hmm, I don't think I'm following you.

        Lemme see:

        I'm forking, then opening a handle inside the 'child'. After I'm done processing, I'm closing the child only handle. Then I'm exiting the child (or join in ithreads I guess).

        That being the case, the handle shouldn't exist in the original thread. I think.

        And sadly, I can't close the original thread, as it's the server itself. I can get the FD number with fileno(), so I might try an explicit close.

        D

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://166363]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-04-19 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls