Sharing in D

bearophile bearophileHUGS at lycos.com
Thu Jul 31 03:28:15 PDT 2008


Bartosz Milewski:
> This requires that all objects, by default, be thread local. For instance, if you declare a global object and initialize it in one thread, another thread will see a different version of this object.<

This requires to be careful using global variables, because you may need lot of memory. On the other hand, each L1 cache can keep such objects safely, with little need of copying such data to other L1 caches.


Robert Fraser:
> However, I'm worried that this may perhaps add even more complexity
> to an already stretched type system.

If the type system is able to manage the transitive immutability, then it can manage this too, I think. The things that are going to stress the type system of D are different ones, I think; for example see the thread about nested templates, where the best solution proposed was to use an union to punch a hole in it.

Bye,
bearophile



More information about the Digitalmars-d mailing list