in reply to Re^2: Using simultaneous threads
in thread Using simultaneous threads
I think you are better off using fork in this situation -it's going to be a lot simpler. Just keep track of the pids you create:
and then call kill 9, @pids in your signal handler.our @pids; ... for my $db (keys %{$db_ds}) { ... my $pid = fork(); if ($pid == 0) { exec(...); } else { push(@pids, $pid); } }
Finally, be sure to read perlthrtut -- it mentions some caveats about using signals and threads.
|
|---|