I ran your code, at the start it has a res memory consumption of around 12MB.
After a minute this is growing to 18MB,
I'd also say the process's memory consumption is growing in random steps.
With perl5.9.5 it uses less memory and the growth is a bit slower, but still there.
I didn't understand what you wrote about my code, since threadscount is locked until it's increased and $count=$threadscount.
Could you perhaps explain this ?
I found however an other flaw, it would be possible that the mainthread obtains it lock on $threadscount BEFORE the first thread increases it.
Since the main thread waits in it's main loop until $threadscount is 0, there could (possibly) be created more than 300 threads.
But (hopefully) fixing this didn't change anything.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.