Boost logo

Boost :

From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2003-02-20 10:53:00


David Abrahams <dave_at_[hidden]> writes:

| Gabriel Dos Reis <gdr_at_[hidden]> writes:
|
| > David Abrahams <dave_at_[hidden]> writes:
| >
| > | Let me reiterate, just in case somebody missed it: this is a similar
| > | problem to that of using a pointer/reference-to-data-member as a
| > | template paramter. You can think of each thread-local global variable
| > | as a data member in a big struct, of which there's a single instance
| > | per thread. The address of this global variable is just as much a
| > | constant as the address of a data member. There's no problem here,
| > | AFAICT.
| >
| > I see your analogy.
| >
| > However, my point is that
| >
| > * a class is closed: that is, by the time you put the closing brace,
| > the "offset" of the data member is a compile-time constant.
| >
| > * the number of thread local variables is potentially unbounded,
| > meaning that, using your analogy, the offset of the corresponding
| > data-member is not known by the time the compiler finishes
| > processing a given translation unit.
|
| OK... is that a problem?

As I'm understanding the issue, yes. I would love to be proved wrong.

| The address of a static global is not known
| when the compiler finishes processing a given translation unit either.

Sure the logical address is known.

As opposed to the address of a variable with a TLS.

-- Gaby


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk