On Fri, 2007-11-02 at 10:46 -0400, Daniel Jacobowitz wrote: > On Fri, Nov 02, 2007 at 07:39:33AM -0700, Ian Lance Taylor wrote: > > The only way I can interpret your comments is that you are assuming > > that all TLS is Global Dynamic (e.g., accessed from a dlopen'ed shared > > library). But stack based thread local storage won't work for > > dlopen'ed shared libraries at all. > > Actually, from context I assume he's talking about pthread_setspecific > and does not know about __thread.
Yes, I was talking about pthread_*, i.e. posix threads. I do know about __thread though. My argument is basically: there is no need for any such feature in a well written program. Each thread already has its own local stack. Global variables should not be used in the first place (except for signals etc where there is no choice). So any (application) program needing TLS (other than the stack) is automatically badly designed. I've been writing code for three decades without using any global variables, ever since I learned about re-entrancy. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net