Subj : Re: pthread state To : comp.programming.threads From : Eric Sosman Date : Tue Jun 21 2005 06:11 pm flower faerie wrote: > Is there an easy way to tell if a pthread is running or has exited? If the thread is joinable, you can call pthread_join() on it. When pthread_join() returns, the thread has exited. If the thread is detached, there's no reliable way I know of to tell whether it has exited. That's usually the wrong question, though: ordinarily, what you really care about is whether it has finished its work. You can arrange any number of ways to figure that out -- have the thread put its "work product" on a queue, or post a semaphore, or whatever makes sense in terms of the thread's role in the entire program's function. -- Eric.Sosman@sun.com .