Re: Sometimes very slow when creating thread

[email protected] (Anders Boström)
Newsgroups perl.ithreads
Message-ID <[email protected]>
Elizabeth Mattijsen wrote:

>> Is there any logical reason to way each thread is created in a 
>> fraction of
>> a second during one start of the program and then each takes 30 
>> seconds at
>> another start of the program. Never in between - its either very 
>> quick or
>> very slow!
>
>
> Yes. Because you have a lot of modules loaded, Perl needs to copy a 
> lot.  The "fast" times, Perl can do this in RAM.  The "slow" times the 
> OS is probably is swapping memory to disk when Perl is asking for more 
> memory to copy the thread.
>
> It's a threshold problem.  Once you're over it, you're in trouble.


Yes could be! I'll keep my eyes on the memory.

But in that case wouldn't there be cases where the creation of the first 
threads would be quick and then when a memory limit is reached, the rest 
is slow??
I my case it is either a quick start for all 6 treads or all of them 
takes 30 seconds each.

Thanks for your help
/anders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.