Hello
code:
while(condition){
pID=fork();
if(!pID){
/* do something */
exit(number);
}
}
wait(number);
Imagine that my while loop creats 4 childs processes. The execution time of each child are diferent, so child nº2 could end first than child nº1. My question is, how my parent process waits for all childs?
code:
while(condition){
pID=fork();
if(!pID){
/* do something */
exit(number);
}
}
wait(number);
Imagine that my while loop creats 4 childs processes. The execution time of each child are diferent, so child nº2 could end first than child nº1. My question is, how my parent process waits for all childs?