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!
CodePudding user response:
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.