For the record: I am "QA" person and was asked to "see what happens" when our client software encounters a resource shortage and cannot get a file handle as it is performing its FIPS self-tests. Because I didn't understand it completely, I brought Timothy Johnson response to the engineering group here. They concur that it is likely an artificial limit, and have been nice enough to provide me a C++ app that accomplishes the task. (albeit not as elegantly as my perl script would have, imo...)

Well, in terms of writing a "production application", Jan you are 100% correct, I wouldn't need all those fhs. However, if the point of writing the script is to _purposefully_ create a resource shortage on the Win32 platform, then the limit is a nuisance.

Well, it's a nuisance to the novice programmer who doesn't know how to recompile their perl interpreter :) Is it fair to say that ActivePerl is preventing the end user from doing something horrible to their system and not a limitation in perl itself? At least that is what I am now understanding.

Regards,
Carlos


Jan Dubois wrote:
On Tue, 18 Apr 2006, Carlos Barbet wrote:
OK, I thought perhaps using the FileHandle module would help, I
rewrote the script in the fashion below. And it remains limited to
3197 using the Cygwin shell or 2045 using cmd.exe. I _assume_ the
issue is something to do with perl being an interpreted language and
an environment variable?? Is there a method to get this script to open
say 250,000 file handles (or whatever is the theoretical limit of file
handles in Win32). As one can guess, I am limited in my programming
experience, thus I don't know if I am barking up the wrong tree.
Perhaps a compiled language should be used for this task????

You are doing something wrong if you need so many filehandles open
simultaneously. In standard IO library for C (stdio) used to limit
filehandles to just a a few dozen. Solaris just recently allowed more
than 256 different file descriptors per process.

Note that there is no limit on how many files you can process
sequentially. If you need that many files open simultaneously, then you
probably should be storing your data in a proper database instead.

Cheers,
-Jan





--
Gilbert Ryle: "Can I help you?"
Student : "Perhaps. I'm looking for 'The Forest', but all I see are these damned 
trees!"
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to