wrzosk <dpr...@gmail.com> wrote:
I believe that when new thread is being created, all static data is
initialized inside new thread. What worries me is the fact, that many
'mini' threads will initialize all static data inside application. This
may be somewhat time consuming.
Maybe there should be a possibility to define 'Pure' thread that doesnt
touch any static data, and in turn it could leave static constructors
untouched.
What do you think
Unless you are spawning lots of threads and at arbitrary times, this is
unlikely to be much of a problem. If it is, you likely should use a thread
pool instead.
Lastly, if you absolutely must, it is possible to spawn a thread using
methods other than D's built-in thread-spawning functions, and those would
not have their static constructors run. On the downside, you lose any
guarantees the compiler could give you, as just about anything that is not
a local variable is in TLS.
--
Simen