Threads and static initialization.

Pelle Månsson pelle.mansson at gmail.com
Sat Dec 18 02:27:22 PST 2010


On 12/18/2010 10:00 AM, Jonathan M Davis wrote:
> The problem is that the OP wants the static constructors to be skipped. If
> they're skipped, anything and everything which could be affected by that can't be
> used. That pretty much means not using TLS, since the compiler isn't going to be
> able to track down which variables in TLS will or won't be affected by it. So,
> you're stuck using shared memory only. _That_ is where the problem comes in.

Exactly, not using TLS. You can still use the heap, as it is not thread 
local. Meaning you can create non-shared anything all you like, as long 
as you're not using TLS.


More information about the Digitalmars-d mailing list