@pids should not ever exceed one less than the $max_processes