Indeed, a double fork here is only needed if you need to collect the exit status of the child without having the server wait for the status. The server forks the child to do the work, but the child forks another child (grandchild), giving the actual work to that grandchild and instead carring the burden of idling instead of making the server idle. When the grandchild has finished the work, the child collects the status and sends it back to the server.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re^2: Creating Child without overhead of Parent (double fork)
by jeffa
in thread Creating Child without overhead of Parent
by cxbast
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |