public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Dominic Gamble <dominic@advancen.com>
To: pthreads-win32@sources.redhat.com
Cc: Simon Wood <swood@monika.com>, John Campbell <jcampbell@monika.com>
Subject: Windows HANDLE resource leak on pthread_create
Date: Mon, 17 Jan 2005 07:03:00 -0000	[thread overview]
Message-ID: <1105945284.31190.3113.camel@watson> (raw)

I have some code which creates a new thread every second or so, which
sends a windows message using (SendMessage) and then exits.

I use pthread_create to create the thread. I use pthread_exit at the end
of my function.

When the program is running the handle count in the windows task manager
seems to increase continually. The rate is approximately 800 handles
every 10 minutes (The thread count is stable though). I took out the
"SendMessage()" call in case it had anything to do with that but the
problem persisted.

I then changed my code to use a basic Win32 API thread using
"CreateThread(...)".

The handle count is now stable.

I'm using the 2003-09-18 Snapshot, however I've read through the change
logs since then and there doesn't appear to be anything relating to a
resource leak on windows Handles. There is a mention of this being fixed
in the 2000-08-10 Snapshot, in the Bugs Fixed section:

"Win32 thread handle leakage bug"

Also in the 2003-08-15 Snapshot it says:

"* POSIX thread handles are now reused and their memory is not freed on
thread exit. This allows for stronger thread validity checking."

Can someone please verify that what is happening is a bug, as it appears
to lock up the entire system once the Handle Count reaches a certain
amount. I couldn't find anything about this on the Known Bugs page on
the website.

FYI: This happens both on Windows 2000 & XP.

Cheers,
Dominic

-- 
Dominic Gamble
Director
Advancen Software Solutions & Multimedia

Phone  1300 888 680        Email dominic@advancen.com
Mobile 0402 059 219        Web   www.advancen.com
Global +61 1300 888 680    PO Box 558, South Melbourne
Fax    +61 3 9525 3446     VIC 3205, Australia

             reply	other threads:[~2005-01-17  7:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-17  7:03 Dominic Gamble [this message]
2005-01-19  8:28 ` Dominic Gamble

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1105945284.31190.3113.camel@watson \
    --to=dominic@advancen.com \
    --cc=jcampbell@monika.com \
    --cc=pthreads-win32@sources.redhat.com \
    --cc=swood@monika.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).