>> I assume that you do quite a lot of initialization for TLS I'm not directly, but Juno has a number of static class constructors that allocate static members, and Outlook creates lots of threads (for example, i see the static constructor of the module juno.com.core get called 20+ times on startup). The Juno lib predates the TLS changes in D2 so i guess that some of these static variables don't need to be thread local, but i haven't had chance to investigate that.
>>Are you using callbacks into the C++ DLL from the module ctors The D dll just exports a couple of 'C' functions that the C++ dll calls. There are no calls in the other direction. >> that might work better if the C++ part also uses thread local storage The C++ dll uses ATL for it's COM stuff, and i'm not sure what that does with TLS in the background. I'll try your suggested change tommorow. Thanks, Richard Webb