【发布时间】:2010-03-17 03:16:04
【问题描述】:
__thread Foo foo;
“foo”实际上是如何解决的?编译器是否用函数调用静默替换“foo”的每个实例? “foo”是否存储在相对于堆栈底部的某个位置,编译器将其存储为“嘿,对于每个线程,在堆栈底部附近有这个空间,而 foo 存储为'offset x from the bottom of stack' “?
【问题讨论】:
标签: linux multithreading gcc thread-local-storage