Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 To: Mo DeJong cc: cygwin AT cygwin DOT com Subject: Re: Linking to cygwin1.dll and msvcrt.dll ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/