Re: Sometimes very slow when creating thread

[email protected] (Elizabeth Mattijsen)
Newsgroups perl.ithreads
Message-ID <p05111b04bc6216076c3d@[192.168.56.3]>
At 08:47 +0000 2/25/04, [email protected] (PerlDiscuss - 
Perl Newsgroups and wrote:
>Thanks Liz, good article,
>  but I didn't find an explanation to my problem!?!
>
>To explain my problem a little bit more:
>It is exactly the same threaded program running on the same data that
>sometimes take 4 seconds to start, and sometimes 3 minutes!
>The threading takes place in the beginning of the program and always in
>the same way.
>
>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.


Liz
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.