# bad, you are only joining 1 # $thr->join; # $thr1->join; #better foreach my $thread ( threads->list ) { $thread->join; } # or you could stuuff the threads into hashes # like my %thrs; for(1..30){ $thrs{$_}{'thread'} = threads->new(\&thread_sub); } #then join them by looping thru the hash keys #### sub thread_sub { while ($test == 0) { if (certain test is true) { $test = 1; #maybe test should be shared return; } } # Now here is where I am getting really god damned lost {my $action = $queue->enqueue;} }