i have tried this - just spawning at once, then iterating through the threads and joining, but as soon as the first join is called, it blocks. it's almost as if I need to yield until each thread is complete, then join, but I'm not quite sure how to do that
–
user210757Jun 22 '10 at 16:37

4

Exactly. join is a blocking operation. But threads that have already been spawned will continue to run while the main process is waiting for join to return. In this case, if you spawn all threads and then join, you'd expect the first join call to take about 5 seconds, and all the other join calls to be very short.
–
mobJun 22 '10 at 16:44

marked as answer. list(), in combination with is_joinable was what i needed - thanks
–
user210757Jun 22 '10 at 17:39

join (not only in Perl) causes calling thread to wait for another thread finish. So your example spawns thread, waits for it to finish, and then spawns another thread, so you get impression that there are no threads spawned at all.