This is the mail archive of the
mailing list for the pthreas-win32 project.
RE: HANDLE leak
- To: 'Geoff Stevens' <geoff dot stevens at macro4 dot com>, "'pthreads-win32 at sourceware dot cygnus dot com'" <pthreads-win32 at sourceware dot cygnus dot com>
- Subject: RE: HANDLE leak
- From: Steve Croall <SCroall at staffware dot com>
- Date: Tue, 12 Oct 1999 17:05:08 +0100
Thanks. Are there any disadvantages to running the threads detached? Is
there any reason why this is not the default behaviour? I wouldn't be
surprised if that was just the way it was :-)
From: Geoff Stevens [mailto:firstname.lastname@example.org]
Sent: 12 October 1999 17:04
Subject: FW: HANDLE leak
I think you should either create your threads detached (set
PTHREAD_CREATE_DETACHED in the attributes) or do a pthread_join for each of
them in main().
At the moment the threads you create are waiting for a join after
pthread_exit, and their Win32 threads (and thus their handles) cannot be
I'm using detached threads with the same levels of the library and NT and
see no increase in handle usage after all my threads have terminated.
From: Steve Croall [SMTP:SCroall@staffware.com]
Sent: 12 October 1999 16:24
Subject: HANDLE leak
The following small program shows the HANDLE count in "Performance Monitor",
for the executable when running, increasing at an alarming rate. Is this
normal or am I not doing something to clear-up? I am using the 1999-09-17
snap-shot on Windows NT 4, service pack 4.
void *thrd_func (void *i)
pthread_exit ((void *) 1);
int main (int argc, char **argv)
int i = 0;
while (!_kbhit ())
pthread_create (&t_id, NULL, (void *) thrd_func, NULL);
Steve Croall ( SCroall@staffware.com )
Chicago law prohibits eating in a place that is on fire.