Re: pthread_join
Re: pthread_join
- Subject: Re: pthread_join
- From: Marc Van Olmen <email@hidden>
- Date: Sun, 12 Sep 2004 15:39:38 -0400
On Sep 12, 2004, at 3:32 PM, Matt Watson wrote:
I'm still surprised that I need to call pthread_detach myself at the
end of function call, because couldn't find any remark of that in the
book, and threads under OS X seems to be created by default in
'attach' mode.
The POSIX standard says that threads are be created joinable by
default. pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)
with the attr used in pthread_create() will make the thread detached
also.
matt I understand that, but my remark was in the case a thread is
joinable. Why am I currently obliged to call at the end of the thread
function, 'pthread_detach' to release the resources of the thread,
because If I dont' call 'pthread_detach' at the end of the thread
function my virtual memory grows and keeps on growing when i create and
delete my threads...
regards,
mvo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden