# some code here.... for (0 ..3)) { my $thr = threads->create ( sub { worker(); } )->detach(); } # Master Thread while (1) { master(); }