I have just had a lecture that sums reaping as:
Reaping
Performed by parent on terminated child (using wait or waitpid)
Parent is given exit status information
Kernel then deletes zombie child process
So I understand that reaping is done by calling wait
or waitpid
from the parent process after which the kernel deletes the zombie process. If this actually is the case, that reaping is done only when calling wait
or waitpid
, why do the child processes actually go away after returning in the entry function - I mean that indeed does seem as if the child processes have been reaped and thus no resources are wasted even though the parent process may not be waiting.
So is "reaping" only possible when calling wait
or waitpid
? If processes are "reaped" as long as they return and exit from their entry function (which I assume all processes do) - what is the point of talking about "reaping" as if it was something special?