Search code examples
windowsconcurrencyprocessoperating-systemparent-child

Dose child process become zombine process when it's not handled by parent process using WaitForSingleObject in Windows?


I'm trying to write a concurrent TCP server in Windows. So the server process will start a child process each time it accepts a connection from the client. I don't know if it's necessary for the parent process to clean the child process in Windows just like what we usually do in Linux. I have been searching for this question for 2 days, but I get only irrelevant answers, like the solution in Linux or there is no UNIX style signal operation in Windows.

Sincerely thank you for your answers!


Solution

  • You don't need to do anything. Just remember to close the thread and process handles CreateProcess gives you.

    You use WaitForSingleObject when you need to wait for a child process to complete its work.

    On Windows, a process object goes away after it has finished executing and all handles to it have been closed.