David Marcin
2005-09-20 17:12:15 UTC
In light of our newfound ability to background processes, Sys_Exit is
what I would consider a bit buggy. It is possible for a process to
spawn several child foreground processes and then exit (by not calling
Wait on them). After it exits the system is in a bit of an inconsistent
state because a few processes have invalid parent pointers and invalid
refcounts. It seems only right that Sys_Exit would "clean up" after a
process by orphaning the child processes and decrementing their refcount.
Note that it is still possible to have zombie processes. A process
"spawn.exe" could spawn several foreground instances of b.exe and then
wait on long.exe several times. During the time spawn.exe is waiting on
long.exe, the instances of b.exe would be zombies. However, when
spawn.exe exits, the zombie b.exe processes would be reaped as a result
of Sys_Exit cleaning up.
Should we do this, or should we leave Sys_Exit as is?
what I would consider a bit buggy. It is possible for a process to
spawn several child foreground processes and then exit (by not calling
Wait on them). After it exits the system is in a bit of an inconsistent
state because a few processes have invalid parent pointers and invalid
refcounts. It seems only right that Sys_Exit would "clean up" after a
process by orphaning the child processes and decrementing their refcount.
Note that it is still possible to have zombie processes. A process
"spawn.exe" could spawn several foreground instances of b.exe and then
wait on long.exe several times. During the time spawn.exe is waiting on
long.exe, the instances of b.exe would be zombies. However, when
spawn.exe exits, the zombie b.exe processes would be reaped as a result
of Sys_Exit cleaning up.
Should we do this, or should we leave Sys_Exit as is?