This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: externs and thread local storage
- From: "Gary Funck" <gary at intrepid dot com>
- To: "Gcc Mailing List" <gcc at gcc dot gnu dot org>
- Date: Mon, 3 Jul 2006 08:30:02 -0700
- Subject: RE: externs and thread local storage
Seongbae Park wrote:
> As I said, you're welcome to implement a new option
> (either a runtime option or a compile time configuration option)
> that will allow mixing TLS vs non-TLS.
In a way, we've already done that -- in an experimental dialact of "C"
called UPC. When compiled for pthreads, all file scope data not
declared in a system header file is made thread local, and in fact all
data referenced through externs is also made thread local. There is a new
syntax (a "shared" qualifier) used by the programmer to identify
objects shared across all threads. Sounds a little scary, but works
amazingly well. Because the tagging of data as __thread local is done
by the compiler transparently, I tend to think that we probably stress
the TLS feature more than most.
> Whether or not it should be enabled for a particular platform
> should be a matter of discussion, and whether or not that patch will be
> accepted in the mainline will be yet another.
For myself, I've worked around the problem, and don't see any consensus
forming, so see little need to come up with a patch for something that
has no support. As far as the process goes, I think it is
better to discuss the issues here to develop a consensus (if any)
before developing a patch.