From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26007 invoked by alias); 17 Jan 2005 07:03:33 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 25839 invoked from network); 17 Jan 2005 07:03:27 -0000 Received: from unknown (HELO volta.advancen.com) (203.89.236.175) by sourceware.org with SMTP; 17 Jan 2005 07:03:27 -0000 Received: from localhost (localhost [127.0.0.1]) by volta.advancen.com (Postfix) with ESMTP id 114BD4400751; Mon, 17 Jan 2005 16:28:34 +1100 (EST) Received: from watson.advancen.nat.com (adsl-22-138.swiftdsl.com.au [218.214.22.138]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by volta.advancen.com (Postfix) with ESMTP id 7A5424400083; Mon, 17 Jan 2005 16:28:33 +1100 (EST) Subject: Windows HANDLE resource leak on pthread_create From: Dominic Gamble To: pthreads-win32@sources.redhat.com Cc: Simon Wood , John Campbell Content-Type: text/plain Organization: Advancen Message-Id: <1105945284.31190.3113.camel@watson> Mime-Version: 1.0 Date: Mon, 17 Jan 2005 07:03:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2005/txt/msg00002.txt.bz2 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