This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: TLS on windows (was: Re: Gfortran on Windows (mingw32) with OpenMP)
- From: Henry Kar Ming Chan <karminghenry at yahoo dot com>
- To: FX Coudert <fxcoudert at gmail dot com>, karminghenry at yahoo dot com
- Cc: GCC Development <gcc at gcc dot gnu dot org>, "fortran at gcc dot gnu dot org GFortran" <fortran at gcc dot gnu dot org>
- Date: Wed, 7 Jun 2006 04:55:40 +0100 (BST)
- Subject: Re: TLS on windows (was: Re: Gfortran on Windows (mingw32) with OpenMP)
Hi, all,
After I refer to the Intel paper titled "Threading
Methodology : Principles and Practices" versin 2.0
published in 2003, I note the following message in the
article mentioning:(from page 22, web site :
http://cache-www.intel.com/cd/00/00/21/93/219349_threadingmethodology.pdf)
_____________________________________________________
OpenMP and thread libraries have mechanisms to create
thread-local storage. Threads can safely access this
storage without synchronization. Use the following
declarations to create thread-local storage in
different threading models:
? In OpenMP use threadprivate
? In Win32, use the TlsAlloc() function
? In Pthreads, use the pthread_key_create function
__________________________________________________
>From the above description, I think that "gfortran
with OpenMP" compiler can also implemented the TLS
using Win32 threads or Pthreads.
Please comment on the above implementation methods.
Thanks.
Best regards,
Henry Kar Ming Chan
--- FX Coudert <fxcoudert@gmail.com> wrote:
> [First, a warning: I'm neither an expert in TLS, nor
> in Windows nor
> in GCC guts
>
> > can we have chance to solve the
> > problem of threadprivate by adding the TLS support
> to
> > mingw32?
>
> The support for TLS (Thread Local Storage) would
> probably come from
> the compiler itself. Windows has TLS (see for
> example http://
>
dotnet.di.unipi.it/Content/sscli/docs/doxygen/pal/localstorage_8c-
>
> source.html and
> http://www.ddj.com/dept/cpp/184403874, or the MSDN
> documentation at
> http://msdn.microsoft.com/library/default.asp?url=/
> library/en-us/dllproc/base/tlsalloc.asp), so you'd
> "only" need to
> teach GCC how to call that.
>
> Now, I don't have competence, time and motivation to
> do that. So, if
> my analysis above is correct, there are three things
> you can do: ask
> around here if someone is interested in this and is
> planning to do
> it; do it yourself, if you have the competence; find
> someone you
> know, that you have leverage on, to do it :)
>
> Now, for an idea of how much work it represents...
> perhaps someone
> here can tell us?
>
> FX
>
Send instant messages to your online friends http://uk.messenger.yahoo.com