incoming client request is receivedthe server runs its reapchildren to issue wait for any dead children by issuing the standard python os waitpid( ,os wnohangcall the os waitpid call attempts to wait for child process to exit and returns its process id and exit status with for its first argumentit waits for any child process with the wnohang parameter for its secondit does nothing if no child process has exited ( it does not block or pause the callerthe net effect is that this call simply asks the operating system for the process id of any child that has exited if any havethe process id returned is removed both from the system process table and from this script' activechildren list to see why all this complexity is neededcomment out the reapchildren call in this scriptrun it on platform where this is an issueand then run few clients on my linux servera ps - full process listing command shows that all the dead child processes stay in the system process table (show as )]ps - uid pid ppid stime tty : pts/ : pts/ : pts/ : pts/ : pts/ : pts/ : pts/ time cmd : : python fork-server py : : [python : : [python : : [python : : [python : : ps - : : -bash when the reapchildren command is reactivateddead child zombie entries are cleaned up each time the server gets new client connection requestby calling the python os waitpid function few zombies may accumulate if the server is heavily loadedbut they will remain only until the next client connection is received (you get only as many zombies as processes served in parallel since the last accept)]python fork-server py [ ]ps - uid pid ppid stime tty time cmd : pts/ : : python fork-server py : pts/ : : ps - : pts/ : : -bash ]server connected by ( ' at sun apr : : server connected by ( ' at sun apr : : ]ps - uid pid ppid stime tty time cmd : pts/ : : python fork-server py : pts/ : : [python : pts/ : : [python : pts/ : : ps - : pts/ : : -bash ]server connected by ( ' at sun apr : : network scripting