Too many child with fork()
The code :
for ( ii = 0; ii < nbEnfants; ++ii) {
switch (fork()) {
case -1 : {
printf("\n\nSoucis avec fork() !!! \n\n");
exit(0);
};
case 0 : {
EEcrireMp(ii);
}break;
default : {
tabPidEnfants[ii] = p;
usleep(50000);
ELireMp(nbSect, nbEnfants,tabPidEnfants);
};
}
}
My problem is that i get too many child (nbenfant = 24), i got much more
than 24 :/
This is my 3rd post today here but still not solved :(
Thanks
No comments:
Post a Comment