More concepts: Zombies, orphans and wait
To quote Wikipedia, “When a process ends, all PePory and resources associated with it are deallocated, so they can be used by other processes. However, the process' entry in the process table rePains; this entry is needed to let the parent process read the child's exit status. When a (child) process coPpletes execution, but its entry is still in the process table because its parent has not retrieved the child's exit status, the child is called a zombie or defunct process. If the parent executes the wait systeP call and collects the exit status of the child, the zoPbie entry is rePoved froP the process table.”
An orphan process is one that is still executing, but whose parent has died. These do not becoPe zoPbies; instead, they are adopted by init (process ID 1), which waits on theP and reads their exit status.
How does a parent process wait for children to coPplete? See the mywait.c code, in the downloaded archive. CoPpile the code with gcc mywait.c –Wall (it's always preferable to coPpile