Re: disappearing zombie thread (not process)
From: David Schwartz (davids_at_webmaster.com)
Date: Fri, 18 Jul 2003 12:01:53 -0700
"Rainer Birkenmaier" <firstname.lastname@example.org> wrote in message
> David Schwartz <email@example.com> wrote:
> > What is a "zombie thread"?
> More or less the same than a zombie process just that it's a thread. ps
> gives this (when the program that I posted has just been started):
> # ps auxw | grep zom
> root 5353 76.5 0.0 3556 380 pts/4 R 11:49 0:01
> root 5354 0.0 0.0 3556 380 pts/4 S 11:49 0:00
> root 5355 0.0 0.0 0 0 pts/4 Z 11:49 0:00
What you're seeing is not really a zombie thread. It's a zombie KSE
(kernel scheduling entity).
> > You seem to think that pthread_join maps to wait.
> Yep, that's more or less what I thought but from your answer I
> understand it's not like that!
> What keeps me busy is, that the zombie only disapears after something
> like 2 or 3 seconds (on my Laptop, a PIII 650Mhz). If the
> controll-thread takes care of it I'd expect it to disappear immediately
I doubt it's considered a high-priority task by the manager thread.
> ... and still: Is there a chance to have the zombie stay there (other than
> the controll-thread is malfunctioning) ... since I have this with
> a large application that I'm looking at?
So long as you either create your threads detached, detach them later,
or join them, you should not leak resources created internally for a thread,
that includes KSEs.