[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mingw-cross-env-list] Solving the Pthreads issue
From: |
Tony Theodore |
Subject: |
Re: [Mingw-cross-env-list] Solving the Pthreads issue |
Date: |
Tue, 11 May 2010 15:44:28 +1000 |
On 11 May 2010 14:21, Martin Lambers <address@hidden> wrote:
> I wrote to both Ross Johnson and the mailing list, and already got a
> response from the mailing list. This situation has apparantly already be
> solved, and in a better way than what I suggested.
>
> Pthreads-win32 uses DLL hooks to automatically execute the attach/detach
> functions. When using static libraries, DLL hooks are not available, so
> the attach/detach functions have to be called manually.
>
> But there is a feature of the PE executable file format used by Windows
> to define hooks also in the case of static linking. Ramiro Polla sent a
> patch that uses this approach. See
> <http://sourceware.org/ml/pthreads-win32/2010/msg00006.html>.
>
> If we're lucky, this already solves the problem. Can someone test this?
>
> One problem might be that libraries which already call attach/detach
> might run into problems, so we might need to be careful about the
> PTW32_STATIC_LIB flag being defined in the header files.
The patch allows the build to succeed, but the test-libgomp.exe
returns somewhat odd results.
Running in linux:
Hello from thread 0, nthreads 2
Hello from thread 1, nthreads 2
Running with wine:
Hello from thread 1, nthreads 2
Hello from thread 1, nthreads 2
Hello from thread 0, nthreads 2
and sometimes
Hello from thread 0, nthreads 2
Hello from thread 0, nthreads 2
Hello from thread 1, nthreads 2
It seems to be much the same if PTW32_STATIC_LIB is defined in the
headers or not.
I've attached the cvs and autostatic patches.
Tony
pthreads-1-cvs-20100305.patch
Description: Text Data
pthreads-2-autostatic.patch
Description: Text Data
- Re: [Mingw-cross-env-list] Support for Windows 95/98/ME? (was: Solving the Pthreads issue), (continued)
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Tony Theodore, 2010/05/08
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Volker Grabsch, 2010/05/09
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Tony Theodore, 2010/05/10
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Martin Lambers, 2010/05/10
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Volker Grabsch, 2010/05/10
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Martin Lambers, 2010/05/11
- Re: [Mingw-cross-env-list] Solving the Pthreads issue,
Tony Theodore <=
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Volker Grabsch, 2010/05/11
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Tony Theodore, 2010/05/11
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Volker Grabsch, 2010/05/11
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Martin Lambers, 2010/05/11
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Volker Grabsch, 2010/05/16
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Tony Theodore, 2010/05/16
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Volker Grabsch, 2010/05/19
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Tony Theodore, 2010/05/20
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Volker Grabsch, 2010/05/11
- Re: [Mingw-cross-env-list] Solving the Pthreads issue, Gregory Smith, 2010/05/11