in reply to How the parent process knows that all its child process has finished execution?

If you can install the forks module, your code could be very simple:
use forks; my $max_threads = 30; for( 1...$max_threads ) { threads->create( \&munge_files, shift(@files_to_munge) ); }# end for() # Wait for our threads to finish: $_->join foreach threads->list; # All done! print "Job was completed.\n"; sub munge_files { my ($file) = @_; # Do stuff with $file... }
  • Comment on Re: How the parent process knows that all its child process has finished execution?
  • Download Code