Light-weight threads

Stanley Steel news-steel at kryas.com
Wed Feb 24 06:51:38 PST 2010


On 2/24/10 2:15 AM, Norbert Nemec wrote:
> 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
That is why features like "immutability by default" are important.  You 
don't have to copy immutable objects.



More information about the Digitalmars-d mailing list