pthread_detach doesn't release memory

Peter Steele psteele at maxiscale.com
Wed May 20 18:56:29 UTC 2009


I create a thread using something like this: 

pthread_t thread; 
pthread_create(&thread, NULL, mythread, NULL); 
pthread_detach(thread); 

I use the detach because I want to make sure the thread's resource are reclaimed when the thread completes. However, this does not seem to work. Each time I create a thread the application's memory footprint grows by 128 bytes and this memory is never released. 

Am I doing this right? 



More information about the freebsd-questions mailing list