On Thu, Mar 14, 2013 at 03:50:27PM -0700, "Martin v. Löwis" wrote:
> Am 14.03.13 12:59, schrieb Stefan Ring:
> > I think you should be able to just take the address of a static
> > __thread variable to achieve the same thing in a more portable way.
>
> That assumes that the compiler supports __thread variables, which
> isn't that portable in the first place.

    FWIW, I make extensive use of __declspec(thread).  I'm aware of GCC
    and Clang's __thread alternative.  No idea what IBM xlC, Sun Studio
    and others offer, if anything.

IBM xlC and Sun Studio also support this feature. From memory, it's also __thread keyword. This features is also supported by the new C11/C++11 standards.
">

(original) (raw)

That's good to hear :-)

(It's a fantastic facility, I couldn't imagine having to go back to manual TLS API stuff after using \_\_thread/\_\_declspec(thread).)

This e-mail was sent from a wireless device.

On 21 Mar 2013, at 09:30, "Baptiste Lepilleur" <baptiste.lepilleur@gmail.com> wrote:



2013/3/15 Trent Nelson <trent@snakebite.org>
On Thu, Mar 14, 2013 at 03:50:27PM -0700, "Martin v. Löwis" wrote:
\> Am 14.03.13 12:59, schrieb Stefan Ring:
\> > I think you should be able to just take the address of a static
\> > \_\_thread variable to achieve the same thing in a more portable way.
\>
\> That assumes that the compiler supports \_\_thread variables, which
\> isn't that portable in the first place.

FWIW, I make extensive use of \_\_declspec(thread). I'm aware of GCC
and Clang's \_\_thread alternative. No idea what IBM xlC, Sun Studio
and others offer, if anything.

IBM xlC and Sun Studio also support this feature. From memory, it's also \_\_thread keyword. This features is also supported by the new C11/C++11 standards.
Baptiste.