thread local storage

Eduardo Rocha erocha.ssa@gmail.com
Wed Feb 7 10:56:00 GMT 2007


Hi Janne,

Thanks for your answer. But I need some more informations.
I am writing a User-Level Thread library and I would like
to use variable privatization. In C if I write that line:

  static __thread int var1;

inside a functions, for example, the access to var1 is made
through a level of indirection. Thus I can allocate memory for
private variables for each thread and change a pointer to
the current private variables when a context switch happens.
I would like to do the same with Fortran, but I don't know if it is
possible get the same indirection effect in Fortran as in C. Do
you know?

Sorry about my English, but I am Brazilian and my first
language is not English.

Thanks in advance,

Eduardo Rocha

On 2/6/07, Janne Blomqvist <Janne.Blomqvist@tkk.fi> wrote:
> Eduardo Rocha wrote:
> > I would like to know if gfortran has support to Thread
> > Local Storage (TLS) like C and C++ (through __thread keyword).
>
> gfortran implements OpenMP private variables with TLS behind the scenes.
>
> --
> Janne Blomqvist
>
>



More information about the Fortran mailing list