What exactly shared means?

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 3 05:39:51 PST 2015


On Saturday, 3 January 2015 at 12:34:10 UTC, Jonathan M Davis via 
Digitalmars-d-learn wrote:
> their memory model into account. The vast majority of D code 
> won't care one
> whit and won't have any problems, because very little of it 
> needs to be
> shared, and thread communication most typically is done via 
> message passing
> using std.concurrency, not by declaring shared variables.

I don't agree with this. If you avoid the problem by message 
passing, then you should do like Go and make it a language 
feature. And accept that you loose out on efficiency and restrict 
the application domain.

If you make "shared" a language feature you also need to back it 
up with semantic analysis and prove that the concept is sound and 
useful (i.e. no need to break encapsulation, not making most 
libraries unusable without unsafe casting etc).


More information about the Digitalmars-d-learn mailing list