From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13930 invoked by alias); 19 Mar 2009 00:34:20 -0000 Received: (qmail 13920 invoked by uid 22791); 19 Mar 2009 00:34:19 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: sourceware.org Received: from bender.grapevine.net.au (HELO bender.grapevine.net.au) (203.129.32.139) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Mar 2009 00:34:11 +0000 Received: from localhost (localhost [127.0.0.1]) by bender.grapevine.net.au (Postfix) with ESMTP id E538DC2092; Thu, 19 Mar 2009 11:34:07 +1100 (EST) Received: from bender.grapevine.net.au ([127.0.0.1]) by localhost (bender.grapevine.net.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VqXTdaLfkV75; Thu, 19 Mar 2009 11:34:07 +1100 (EST) Received: from localhost.localdomain (ppp-182.208.127.121.grapevine.net.au [121.127.208.182]) by bender.grapevine.net.au (Postfix) with ESMTP id 8AC1BC2073; Thu, 19 Mar 2009 11:34:07 +1100 (EST) Message-ID: <49C192FE.8070809@homemail.com.au> Date: Thu, 19 Mar 2009 00:34:00 -0000 From: Ross Johnson User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: Torsten Andre2 CC: pthreads-win32@sourceware.org Subject: Re: Pthread_join waits endlessly for already ended thread References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00016.txt.bz2 I'm looking for possible bugs in the library that might explain this. For example, pthread_join() relies on the underlying Win32 thread handle close being signalled and I don't think this is occurring in all cases. 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 library are built using the same cleanup style. If you run against the pthreadVCE2.dll then you must build your code with __CLEANUP_CXX defined. If no style is defined then __CLEANUP_C is used by default (assuming pthreadVC2.dll). But AFAICS this shouldn't cause the longjmp() hang issue which is internal to the library. Unless you have a specific need, use pthreadVC2.dll. Also, if you're using the VS project file from the library source code please check it carefully because it's not really maintained. The pre-built dlls are all built using command line tools and the makefiles 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 > >