I noticed a strange phenomenon with threads and shared hashes and
arrays.  It appears that every time you add new elements to such a
variable, the handle count goes up.  I don't know if this will cause
problems, but because of this my processes will end up using anywhere
from 5,000-50,000 handles.  I noticed some unstability on Win98, and
this may be related, I'm not sure.

My test platform is Win2000 Server, with ActivePerl 5.8.6 build 811. 
I was using 5.8.4, but I upgraded today in the hopes that might fix
the handle situation, but it's still the same.

I'm attaching a small test program (75 lines) that illustrates the
problem.  Running it with the default settings (128 elements, 1 worker
thread) produces the following results on my test machine:
Memory: 4292 KB
Handles: 5149
Interestingly, if you increase the number of worker threads beyond 1,
there is no extra used handles.  It's only when you increase the
number of elements in the shared hash/array that the handle count goes
up.  I'd like my program to be able to handle several thousand
elements in those vars...

Is this actually a bug in Perl's thread implementation, or is my code
at fault?  If so, what can I do to fix it?  If not, how can I report
this bug?

Attachment: handles.pl
Description: Binary data

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to