Skip navigation.
Home
The QNX Community Portal

View topic - Thread is ALive or Dead ?

Thread is ALive or Dead ?

For the old QNX2 and QNX4 RTOS

Thread is ALive or Dead ?

Postby rsreddy » Sat Jan 07, 2012 1:29 pm

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 ?
rsreddy
Active Member
 
Posts: 16
Joined: Tue Jun 07, 2011 5:38 am
Location: HYDERABAD

Re: Thread is ALive or Dead ?

Postby maschoen » Mon Jan 09, 2012 10:30 am

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.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: Thread is ALive or Dead ?

Postby Tim » Mon Jan 09, 2012 5:48 pm

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
Tim
Senior Member
 
Posts: 1392
Joined: Wed Mar 10, 2004 12:28 am

Re: Thread is ALive or Dead ?

Postby maschoen » Mon Jan 09, 2012 8:32 pm

Tim wrote: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?

KGB


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.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm


Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 3 guests

cron