Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - TraceEvent: detecting thread death, distinguishing between DEAD STATE and final free up of resources: (1 Item)
   
TraceEvent: detecting thread death, distinguishing between DEAD STATE and final free up of resources  
Hello,

another question regarding the TraceEvent exact events meaning;
the basic issue is I think the lack of source code, but maybe there is some precise documentation somewhere? I am 
interested in what the events mean _exactly_.

I am trying to detect the point in time when a thread is actually destroyed, waiters are woken up and resources are 
freed.

I was using the event _TRACE_PR_TH_DESTROY_T   (_TRACE_THREAD_DESTROY) before,
but looking at the results this seems to mean something entirely different.

I see the _TRACE_THREAD_DESTROY event before I see the TRACE_DEAD state change event,
and I seem to not have any event for detecting whether all resources have been successfully freed, waiters notified, etc
.

I do have some event for the whole process (DESTROY_P seems to be the one), but not for the single thread.

It would be very useful to be able to pinpoint when the resources are actually freed, and the (pid, tid) couple is 
released back to the OS. This would detect Zombie threads for example.

I saw some changes in some old QNX 6.x source code third party repo,

https://github.com/vocho/openqnx.git

which apparently tried to work around this very problem (in nano_thread,c, see mt_trace_task_delete):

https://github.com/vocho/openqnx/blob/cc95df3543a1c481d4f8ad387e29f0d1ff0c87fe/trunk/services/system/ker/nano_thread.c#
L565

Thank you for any advice,

Claudio