Subj : Re: pthread_create and memory To : comp.programming.threads From : Sam Siegel Date : Sat Mar 12 2005 11:56 am Bluejack wrote: > On Fri, 11 Mar 2005 12:55:31 GMT, Gio67 wrote: > >> I have an other request: do you know any api of kernel to know the >> status of >> the threads ?? > > > Depending on what you mean by "status" the api you are probably looking > for is pthread_join(): > > http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_join.html > > It sounds like you could use a decent reference manual. Although it's > not comprehensive, this is a good place to start: > > > http://www.llnl.gov/computing/tutorials/workshops/workshop/pthreads/MAIN.html > > > -bluejack If your design does not require you to syncronise at thread-end using pthread_join to reclaim its resources, use the correct combinations of pthread_attr_init, pthread_attr_destroy and pthread_attr_setdetachstate to set each new thread to PTHREAD_CREATE_DETACHED before using pthread_create. In this fashion using pthread_join is not allowed and system-level thread specific resources assoicated the pthread_create will be automatically reclaimed at thread-end. http://www.opengroup.org/onlinepubs/007908799/xsh/pthread.h.html Sam .