Thread is ALive or Dead ?

How to know thread is alive or dead in qnx 6.3.0 . Is there any procedure to check the thread status other than pidin ?

There is no such thing as a Dead thread.

Take a look at the architecture manual. Threads can be in various states, eg. READY, RUNNING, SEND_BLOCKED, REPLY_BLOCKED, RECEIVE_BLOCKED. There are a few others.

A process can be dead. Is that what you mean? In this state it has already had all it’s memory released. It continues on to provide the parent process with an exit code.

Actually there are Zombie threads. Those are threads that have exited/finished running but have not been reclaimed by the O/S because the parent process is still running.

Is that what you are considering to be a ‘dead’ thread?


Tim, I stand corrected. There is a little more to this. Threads are either joinable or independent. Independent threads disappear when they exit. Joinable threads stay around as Zombie’s until they join with another thread. I’ve never written an application where I wanted to join with a Zombie thread so I always change threads that exit into independent threads. The default is joinable, so this needs to be done.

And as we all know, zombies are dead, but they walk around and try to eat your brains.