I am having this problem:
I have Perl script that uses a “for” to launch many processes children using “fork”, the problem is that: the children are left zombies, and therefore arrives at a point in which we cannot create more processes .
We thank for any aid that can give us. Our code is:
for ($count = 0; $count <= 100; $count++) {
FORK: {
if ($pid = fork){
# father code ;
} elsif (defined $pid) {
# children code
}
exit ;
} elsif ($! =~ /Resource temporarily unavailable/){
print "Couldn’t create process";
sleep 5;
redo FORK;
} else{
# failure
die "can’t fork: $! \n";
}
}
}
[sig][/sig]
I have Perl script that uses a “for” to launch many processes children using “fork”, the problem is that: the children are left zombies, and therefore arrives at a point in which we cannot create more processes .
We thank for any aid that can give us. Our code is:
for ($count = 0; $count <= 100; $count++) {
FORK: {
if ($pid = fork){
# father code ;
} elsif (defined $pid) {
# children code
}
exit ;
} elsif ($! =~ /Resource temporarily unavailable/){
print "Couldn’t create process";
sleep 5;
redo FORK;
} else{
# failure
die "can’t fork: $! \n";
}
}
}
[sig][/sig]