delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/20/13:10:01

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Authentication-Warning: hp2.xraylith.wisc.edu: khan owned process doing -bs
Date: Fri, 20 Jul 2001 12:09:20 -0500 (CDT)
From: Mumit Khan <khan AT NanoTech DOT Wisc DOT EDU>
To: Mo DeJong <mdejong AT cygnus DOT com>
cc: cygwin AT cygwin DOT com
Subject: Re: Linking to cygwin1.dll and msvcrt.dll ?
In-Reply-To: <Pine.SOL.3.91.1010719002515.8159B-100000@cse.cygnus.com>
Message-ID: <Pine.HPP.3.96.1010720120335.16500P-100000@hp2.xraylith.wisc.edu>
MIME-Version: 1.0

On Thu, 19 Jul 2001, Mo DeJong wrote:

> Of course, there may still be a problem. The reason Tcl started
> using _beginthreadex() instead of CreateThread() was related
> to memory that would not be deallocated after a call to
> ExitThread(). Here are some docs I found on the subject.
> 
> http://support.microsoft.com/support/kb/articles/q132/0/78.asp
> http://www.microsoft.com/msj/0799/win32/win320799.htm
> http://technology.niagarac.on.ca/courses/comp831/win32/_beginthread.htm 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__beginthread.2c_._beginthreadex.asp
> 
> My question is, is this same memory leak problem going
> to show up when using Cygwin's CreateThread() and
> C library APIs?

I believe the memory leak is only applicable if you're using MSVCRT
runtime, but that's not the case with Cygwin. The *ex functions close
the various handles and TLS' that are created per thread if I remember 
correctly. 

> Even if this is not going to be a problem, should
> Cygwin provide the _beginthread, _beginthreadex,
> _endthread, and _endthreadex methods to ease
> porting existing apps that have already dealt
> with this issue?

It's tempting, but IMO Cygwin should stay away from creeping feature'ism
such as this. Most of the threaded applications I see tend to use Win32
API directly, and Cygwin of course supports that just fine. Of course, we
can always have msvcrt helper/port library that can facilitate ports.

Regards,
Mumit



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019