[ 
https://issues.apache.org/jira/browse/STDCXX-1023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Farid Zaripov updated STDCXX-1023:
----------------------------------

    Description: 
>From MSDN:
{noformat}
The Visual C++ compiler supports a syntax that enables you to declare 
thread-local variables:
_declspec(thread). If you use this syntax in a DLL, you will not be able to 
load the DLL
explicitly using LoadLibrary on versions of Windows prior to Windows Vista. If 
your DLL will be
loaded explicitly, you must use the thread local storage functions instead of 
_declspec(thread).
{noformat}

Personally, I've got the Access Violation Exception during performing 
Boost.Python regression tests, since python.exe process loading the DLL using 
LoadLibrary() function.

Since the user could make own DLL, linked against stdcxx statically or 
dynamically, and load this DLL using LoadLibrary() function, we should not use 
the implicit TLS in stdcxx library to avoid such problems. If we want use 
thread local variables in stdcxx, we should use 
TlsAlloc()/TlsFree()/TlsGetValue()/TlsSetValue() functions on Windows.

  was:
>From MSDN:
{noformat}
The Visual C++ compiler supports a syntax that enables you to declare 
thread-local variables: _declspec(thread). If you use this syntax in a DLL, you 
will not be able to load the DLL explicitly using LoadLibrary on versions of 
Windows prior to Windows Vista. If your DLL will be loaded explicitly, you must 
use the thread local storage functions instead of _declspec(thread).
{noformat}

Personally, I've got the Access Violation Exception during performing 
Boost.Python regression tests, since python.exe process loading the DLL using 
LoadLibrary() function.

Since the user could make own DLL, linked against stdcxx statically or 
dynamically, and load this DLL using LoadLibrary() function, we should not use 
the implicit TLS in stdcxx library to avoid such problems. If we want use 
thread local variables in stdcxx, we should use 
TlsAlloc()/TlsFree()/TlsGetValue()/TlsSetValue() functions on Windows.


> [Windows] Don't use implicit TLS variables in stdcxx library
> ------------------------------------------------------------
>
>                 Key: STDCXX-1023
>                 URL: https://issues.apache.org/jira/browse/STDCXX-1023
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Thread Safety
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0, 4.2.1
>         Environment: Windows
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>             Fix For: 4.2.2
>
>
> From MSDN:
> {noformat}
> The Visual C++ compiler supports a syntax that enables you to declare 
> thread-local variables:
> _declspec(thread). If you use this syntax in a DLL, you will not be able to 
> load the DLL
> explicitly using LoadLibrary on versions of Windows prior to Windows Vista. 
> If your DLL will be
> loaded explicitly, you must use the thread local storage functions instead of 
> _declspec(thread).
> {noformat}
> Personally, I've got the Access Violation Exception during performing 
> Boost.Python regression tests, since python.exe process loading the DLL using 
> LoadLibrary() function.
> Since the user could make own DLL, linked against stdcxx statically or 
> dynamically, and load this DLL using LoadLibrary() function, we should not 
> use the implicit TLS in stdcxx library to avoid such problems. If we want use 
> thread local variables in stdcxx, we should use 
> TlsAlloc()/TlsFree()/TlsGetValue()/TlsSetValue() functions on Windows.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to