[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] GLPK 4.61: thread local storage in Windows DLL
From: |
Heinrich Schuchardt |
Subject: |
Re: [Help-glpk] GLPK 4.61: thread local storage in Windows DLL |
Date: |
Mon, 9 Jan 2017 22:46:09 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 |
Hello Andrew,
https://msdn.microsoft.com/en-us/library/6yh4a9k1.aspx
describes when the Windows specific restrictions for thread local
storage in DLLs apply:
"On Windows operating systems before Windows Vista"
We should check the Windows version in DllMain and return false if the
Windows Version is below Vista and symbol TLS is defined.
Please, apply the appended patch.
Best regards
Heinrich
On 01/09/2017 08:32 PM, Heinrich Schuchardt wrote:
> Hello David,
>
> the thread local storage is not correctly implemented for usage with
> Windows in a DLL. See
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms686997
>
> I think we should do the following:
>
> Write a test case that demonstrates the usage of multithreading GLPK
> using the pthread library.
>
> Add a pthread emulation for Windows so we can use the same test code
> with Windows and with Posix. For a minimalistic implementation see
> http://sqlstat.sourceforge.net/doxygen/html/sqlthread_8h_source.html
>
> Rewrite the allocation and freeing of the env variable according to the
> Windows DLL requirements.
>
> Best regards
>
> Heinrich Schuchardt
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk
>
0001-Check-Windows-version-when-using-TLS.patch
Description: Text Data