Sharing in D

Walter Bright newshound1 at digitalmars.com
Thu Jul 31 16:44:03 PDT 2008


downs wrote:
> IMHO, however, most global variables are intended to be instantiated
> only once, not once per thread. Because of this, the success of this
> model hinges on how easy an object can be transferred between
> threads. Some sort of language enforced blocking, maybe?

The idea is to no longer allow unsynchronized uncontrolled sharing of 
data between threads as the *default* behavior. If you want to do it, 
you'll have to do it *intentionally*.

Note that invariant data will be implicitly shared because it does not 
need synchronization or fencing.



More information about the Digitalmars-d mailing list