Gangabass has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Monks!
I need your help again. My question is why i have zombies process when i run my program?
Zombies looks like so:
3614 pts/1 D 0:00 /usr/bin/perl /root/USS/uss.pl 3616 pts/1 D 0:00 /usr/bin/perl /root/USS/uss.pl 3617 pts/1 Z 0:00 uss.pl <defunct> 3618 pts/1 Z 0:00 uss.pl <defunct> 3619 pts/1 Z 0:00 uss.pl <defunct> 3620 pts/1 Z 0:00 uss.pl <defunct> 3621 pts/1 D 0:00 /usr/bin/perl /root/USS/uss.pl
Here is part of program:
foreach my $row (@$sections) { if (my $pid = fork) { push @pids, $pid; } else { open BIDS, ">>", $CONFIG{BIDS_FOLDER} . "{currentsite}_" . $row->[ +0] . ".svd" or die "Could't open bids file!"; flock(BIDS, 2); print "$site_id, $row->[0], $row->[1]\n"; $found += search_bids( $site_id, $row->[0], $row->[1] ); flock(BIDS, 8); close BIDS; exit; } } for (my $i = 0; $i <= $#pids; $i++) { waitpid($pids[$i], 0); }
In search_bids sub i'm printing into BIDS and doing some LWP::UserAgent (getting pages and parse it) stuff.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fork and zombies
by ikegami (Patriarch) on Oct 24, 2007 at 06:49 UTC | |
by Gangabass (Vicar) on Oct 24, 2007 at 07:52 UTC | |
|
Re: fork and zombies
by Zaxo (Archbishop) on Oct 24, 2007 at 07:11 UTC | |
|
Re: fork and zombies
by Somni (Friar) on Oct 24, 2007 at 06:51 UTC | |
by wolfger (Deacon) on Oct 24, 2007 at 16:52 UTC |