[cfe-dev] __thread keyword, LLVM 3.2 & Xcode 4.6

Jean-Daniel Dupas devlists at shadowlab.org
Tue Nov 6 02:50:14 PST 2012


Le 6 nov. 2012 à 11:13, Jacob Carlborg <doob at me.com> a écrit :

> On 2012-11-06 10:04, Jean-Daniel Dupas wrote:
> 
>> Moreover, it has already be specified in the previous discussion that supporting C++ TLS required OS support. Updating Xcode does not change that.
> 
> As far as I understand, Mac OS X supports TLS since 10.7 Lion. At least the dynamic linker has code which seems to indicate it is supported.
> 

There is 2 thing to consider. The system must know how to reserve memory on each thread to store the thread local variable (the part Lion implements), which is enough to use TLS with simple C construct.
The second part is to support invocation of initialization/cleanup functions for TLS values each time a thread is created/destroyed. This part is require to support C++ object with a constructor/destructor.  I didn't dig in the dyld / libc / kernel sources for OS X.8, but I don't think it support it yet. 


> -- 
> /Jacob Carlborg
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- Jean-Daniel








More information about the cfe-dev mailing list