title: Perl Parallel::ForkManager wait_all_children() takes excessively long time
body: <p>I have a script that uses <code>Parallel::ForkManager</code>. However, the wait_all_children() process takes incredibly long time even after all child-processes are completed. The way I know is by printing out some timestamps (see below). Does anyone have any idea what might be causing this (I have 16 CPU cores on my machine)?</p>
  
  <pre><code>my $pm = Parallel::ForkManager-&gt;new(16);
  for my $i (1..16) {
      $pm-&gt;start($i) and next;
  
      ... do something within the child-process ...
  
      print (scalar localtime), " Process $i completed.\n";
      $pm-&gt;finish();
  }
  print (scalar localtime), " Waiting for some child process to finish.\n"; 
  $pm-&gt;wait_all_children();
  print (scalar localtime), " All processes finished.\n"; 
  </code></pre>
  
  <p>Clearly, I'll get the <code>Waiting for some child process to finish</code> message first, with a timestamp of, say, <code>7:08:35</code>. Then I'll get a list of <code>Process i completed</code> messages, with the last one at <code>7:10:30</code>. However, I do not receive the message <code>All Processes finished</code> until <code>7:16:33</code>(!). Why is that 6-minute delay between 7:10:30 and 7:16:33? Thx!</p>