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.
In reply to fork and zombies by Gangabass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |