I got around my problems with a slow startup by doing the following: I made a new startup-program that has a minimum of "use" and this program starts all the threads I need. Each thread will then "require" a module where the "real" code is hided (with all "use" etc) and start its work in a routine from that module.
Minimum of "use" means that I had to put all shared variables in a separate module that was "used" before threading. The result is the same amount of memory consumed and the program in total uses the same modules etc. But, letting each thread loading everything after it was created was far more stable then letting the creation of the thread handle all the copying!?! If this behaviour is a problem in the perl-threads-code or in the Windows threading, I leave to the ithread-gurus to think about. Thanks for the help Anders >From "Sometimes very slow when creating thread" Anders bostr�m wrote: > Elizabeth Mattijsen wrote: > > 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.
