Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Heavyweight threads?: (2 Items)
   
Heavyweight threads?  
We're implementing multi-threaded applications in our projects and in our unit tests, where we are creating and 
canceling multiple threads our applications are running very slowly.  Using the Process Information tab of the QNX 
System Information perspective we see lots of dead threads that don't seem to get cleaned up (and then only very slowly)
 when the application exits.  Are cancelled threads never cleaned up until the process exits?  Is there manual clean up 
of threads we should be preforming?

Thanks,

Gordon Molek
Zebra Technologies, Corp.
Re: Heavyweight threads?  
On Tue, Jul 01, 2008 at 10:52:37AM -0400, Gordon Molek wrote:
> We're implementing multi-threaded applications in our projects and in our unit tests, where we are creating and 
canceling multiple threads our applications are running very slowly.  Using the Process Information tab of the QNX 
System Information perspective we see lots of dead threads that don't seem to get cleaned up (and then only very slowly)
 when the application exits.  Are cancelled threads never cleaned up until the process exits?  Is there manual clean up 
of threads we should be preforming?
> 

If you're not interested in their exit status and don't want
any synchronization on their exit you can create them in the
detached state (pthread_attr_setdetachstate()) or have them
call pthread_detach() after they're created.  Otherwise you
have to call pthread_join() to get their exit status and
have them fully exit.


-seanb