From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31346 invoked by alias); 19 Mar 2009 11:54:12 -0000 Received: (qmail 31336 invoked by uid 22791); 19 Mar 2009 11:54:10 -0000 X-SWARE-Spam-Status: No, hits=0.8 required=5.0 tests=AWL,BAYES_50,WHOIS_MYPRIVREG X-Spam-Check-By: sourceware.org Received: from smtp113.mail.mud.yahoo.com (HELO smtp113.mail.mud.yahoo.com) (209.191.84.66) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 19 Mar 2009 11:54:05 +0000 Received: (qmail 35486 invoked from network); 19 Mar 2009 11:54:03 -0000 Received: from unknown (HELO pc) (virgilio_fornazin@189.1.188.5 with login) by smtp113.mail.mud.yahoo.com with SMTP; 19 Mar 2009 11:54:02 -0000 From: "Virgilio Alexandre Fornazin" To: "'Ross Johnson'" , "'Torsten Andre2'" Cc: References: <49C192FE.8070809@homemail.com.au> In-Reply-To: <49C192FE.8070809@homemail.com.au> Subject: RE: Pthread_join waits endlessly for already ended thread Date: Thu, 19 Mar 2009 11:54:00 -0000 Message-ID: <00c801c9a889$66077340$321659c0$@com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable x-cr-puzzleid: {7EF79B34-C22D-467B-BDA7-E0D4A04E184E} x-cr-hashedpuzzle: Bh2O BufU F+SE GKWW KtmU LXR7 Lu7N L722 MPSv U4fT VMgd aFfJ bQPG bWBu cI6Z eYzF;3;cAB0AGgAcgBlAGEAZABzAC0AdwBpAG4AMwAyAEAAcwBvAHUAcgBjAGUAdwBhAHIAZQAuAG8AcgBnADsAcgBvAHMAcwAuAGoAbwBoAG4AcwBvAG4AQABoAG8AbQBlAG0AYQBpAGwALgBjAG8AbQAuAGEAdQA7AHQAYQBuAGQAcgBlADIAQABkAGUALgBpAGIAbQAuAGMAbwBtAA==;Sosha1_v1;7;{7EF79B34-C22D-467B-BDA7-E0D4A04E184E};dgBpAHIAZwBpAGwAaQBvAF8AZgBvAHIAbgBhAHoAaQBuAEAAeQBhAGgAbwBvAC4AYwBvAG0ALgBiAHIA;Thu, 19 Mar 2009 11:53:54 GMT;UgBFADoAIABQAHQAaAByAGUAYQBkAF8AagBvAGkAbgAgAHcAYQBpAHQAcwAgAGUAbgBkAGwAZQBzAHMAbAB5ACAAZgBvAHIAIABhAGwAcgBlAGEAZAB5ACAAZQBuAGQAZQBkACAAdABoAHIAZQBhAGQA X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2009/txt/msg00017.txt.bz2 I had a problem similar to this, and creating an event handle for signaling solves nothing. I had this problem in plain win32 threads before. This always happened in DLL_PROCESS_DETACH.=20 It=B4s probably a bad design / limitation in win32 shared library model. The cause, if I remember,=20 is that the heap is locked in some way that functions related to thread (TerminateThread if I'm=20 not missing other) must access this heap, then it deadlocks in some locking Windows have internally. Install debug symbols for your platform. When the thread get 'stuck', do a break all and get the backtrace for blocking thread (probably the thread calling pthread_join). Then you can see what=20 is happening. Hope to help fix this []'s Virgilio -----Original Message----- From: pthreads-win32-owner@sourceware.org [mailto:pthreads-win32-owner@sourceware.org] On Behalf Of Ross Johnson Sent: quarta-feira, 18 de mar=E7o de 2009 21:34 To: Torsten Andre2 Cc: pthreads-win32@sourceware.org Subject: Re: Pthread_join waits endlessly for already ended thread I'm looking for possible bugs in the library that might explain this.=20 For example, pthread_join() relies on the underlying Win32 thread handle=20 close being signalled and I don't think this is occurring in all cases.=20 Replacing this with a dedicated event may be a better way to go. Re cleanup styles in general, just make sure your code and the pthreads=20 library are built using the same cleanup style. If you run against the=20 pthreadVCE2.dll then you must build your code with __CLEANUP_CXX=20 defined. If no style is defined then __CLEANUP_C is used by default=20 (assuming pthreadVC2.dll). But AFAICS this shouldn't cause the longjmp()=20 hang issue which is internal to the library. Unless you have a specific=20 need, use pthreadVC2.dll. Also, if you're using the VS project file from the library source code=20 please check it carefully because it's not really maintained. The=20 pre-built dlls are all built using command line tools and the makefiles=20 included. Ross Torsten Andre2 wrote: > Hello, > > I'm having trouble concerning pthread_join as described in this [1] > posting. A "thread A" endlessly waits for an already ended "thread B" which > called "return NULL" or "pthread_exit(NULL)" (tried both). Sometimes it > seems if you wait long enough thread A passes the pthread_join statement, > though not always. Unfortunately I haven't been able to find anything in > the mail archive, though I am sure that this has been covered before. > > Thread B hangs while calling longjmp (sp->start_mark, exception) in > ptw32_throw.c. I have read about the different styles to cleanup, but I > have to admit that currently I don't understand what they are about. All > that matters is that I get pthreads to execute properly at the moment. > > I downloaded pthreads 2.8.0 source code and use Visual Studio 2008 > Professional C++ to compile it using Win32-Debug settings on a Windows > Server 2008 x64 system. I haven't changed any settings of the VC++ > project . The program calling pthread functions is written in C++. Besides > using the source code without any alterations, I also tried to use the > binary dll versions VC2 and VCE2. Both dll's did not solve the problem. > > In [1] Ross states the problem may be another dllmain being called. Though > I don't believe that's the problem in my case, I don't define any other > dllmains but the one in Pthreads. Most probably, I guess, the problem is a > wrong defined symbol or something related. > > Can someone please give me a hint how to get pthread to work properly? Any > help is highly appreciated. Thank you. > > Cheers, > Torsten > > > > [1] http://www.nabble.com/pthread_join-problem-td9687824.html > >=20=20=20 __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger http://br.beta.messenger.yahoo.com/