Just another point about TLS. extern(C) /*__thread*/ int foo; At some point you want to be able to access C++ TLS variables so emulation should not replace native TLS support.