in reply to Just can't get threads to work

Adding the following line after you've started your threadsm would prevent the main thread from terminating before the threads have finished and allow your code to work. You can also do away with the sleep as it is just slowing things up.

$_->join for threads->list;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Just can't get threads to work
by stellagoddc (Novice) on Apr 20, 2006 at 16:01 UTC
    Thanks that kind off worked

    Unfortunately I found myself running out of memory, when I really pushed the threads. putting ->join at the end of each new thread seemed to fix teh memory problem

    Thanks again