my @threads = map{ threads->create( \&worker, $log, \$logSem, $from + ($_ - 1), $t, $to) ; } 1 .. $t ;