From: Ken Hagan (K.Hagan_at_[hidden])
Date: 2003-02-20 11:20:56
Alexander Terekhov wrote:
> Ken Hagan wrote:
>> 3a If we allow C<&k> [...] It is then possible to initialise static
>> variables [...] and the results depend on the thread that ran
>> first. Again, we have the same "problem" passing a pointer to
>> a function, so I'm not bothered by this.
> 3b We allow C<&k> and make all its statics thread-local as well. The
> "problem" is that, probably, it will result in an equal number of
> somewhat irritated programmers as the 3a above.
Unless you extend "its statics" to cover all static duration variables
that might be accessed (including those accessed by called functions,
and therefore invisible to the compiler), this is no different from 3a.
I'm not sure how much irritation is actually likely. Any decision here
is only ever going to upset people instantiating templates on per-thread
data. That's the sort of edge case where I'd expect programmers to learn
the rules before writing any code. As long as those rules don't make
reasonable things impossible, we should be fine.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk