Light-weight threads

ds dsimcha at yahoo.com
Wed Feb 24 05:45:43 PST 2010


== Quote from Norbert Nemec (Norbert at Nemec-online.de)'s article
> Hi there,
> I just found that recent change in the language to make all global
> variables thread-local by default. This makes me think of a major
> performance problem: every thread creation will have to copy all the
> thread-local variables. This makes it impossible to efficiently spawn
> many light-weight threads even if they do not make use of the global
> variables at all.
> I guess I am not the first one to spot this problem? I believe that
> thread creation should come with as little overhead as possible. Maybe a
> concept of light-weight threads based on side-effect free code could
> complement the regular threads?
> Just a quick idea to throw into discussion...
> Greetings,
> Norbert

What's wrong with using thread/task pools for these situations?



More information about the Digitalmars-d mailing list