Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2009 11:56:24 -0700 (PDT)
From:      Peter Steele <psteele@maxiscale.com>
To:        #freebsd-questions <freebsd-questions@freebsd.org>
Subject:   pthread_detach doesn't release memory
Message-ID:  <19206470.1651242845780966.JavaMail.HALO$@halo>

next in thread | raw e-mail | index | archive | help
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? 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19206470.1651242845780966.JavaMail.HALO$>