From: Alexandre Pereira da Silva <alexandre.pereira@po...> - 2004-01-31 15:16:46
> > + //Get rid of zombie processes
> > + signal(SIGCHLD, SIG_IGN);
> This won't work on all of the time (particularly, it won't on Linux <
> 2.6 (it may work on Redhat's 2.4 because they patch their kernel
> extensively)). On 2.4, this has no effect I believe. However, this =
> not guaranteed by POSIX to work.
It's supported by linux, from 2.2 I think, but really not portable. =
There are some other unixes that also do this, but not all.
> That said, I haven't actually seen any zombie processes on my 2.4
> system. This is probably because the mplayer process is created from
> another thread (which is actually treated as a separate process on 2.4
> without CLONE_THREAD), and when that thread exits, mplayer gets
> reparented to init, which calls waitpid(). So, zombies happen to not =
> a problem on 2.4. But, you may see them on 2.6 or with Fedora. Has
> anyone seen them there without this change?
> In any case, since this is extermely non-portable, and also, =
> with other processes that the browser or other plugins want to start =
> call waitpid() on, I don't think this is a good idea. The right way =
> do this would be to call waitpid() from the playPlaylist thread
> (_without_ WNOHANG) around the same time the control stream is closed,
> just like pclose() would.
Ok. Need to implement that.