Nvidia, TLS and __thread keyword -- an observation

Terry Lambert tlambert2 at mindspring.com
Wed Jun 18 01:56:22 PDT 2003


David Xu wrote:
[ ... implicit TLS initialization and destruction ... ]

> I believe this will add overhead to thread creating and destroying,

Yes.  It will.  See my other posting for the tradeoffs.  The
complexity is not as bad as Marcel makes out, but it's still
a bad tradeoff for most existing threaded applications and
libraries, even if we thing more people will use implict TLS
as time goes on.

I think it's the wrong tradeoff, too.  I would make them burn
a general purpose register -- one that they are allowed to burn,
as an application -- on FreeBSD.  I have a hard time believing
that any of their functions use up all the registers, even on
a register-poor CISC architecture like x86; if they are that
complex, then they are doing so much stuff that explicit TLS
access overhead would be lost in the noise.

-- Terry


More information about the freebsd-threads mailing list