Linux's thread local storage implementation

Posted by anon on Stack Overflow See other posts from Stack Overflow or by anon
Published on 2010-03-17T03:16:04Z Indexed on 2010/03/17 7:21 UTC
Read the original article Hit count: 345

__thread Foo foo;

How is "foo" actually resolved? Does the compiler silently replace every instance of "foo" with a function call? Is "foo" stored somewhere relative to the bottom of the stack, and the compiler stores this as "hey, for each thread, have this space near the bottom of the stack, and foo is stored as 'offset x from bottom of stack'"?

© Stack Overflow or respective owner

Related posts about linux

Related posts about thread-local-storage