Sharing in D
Steven Schveighoffer
schveiguy at yahoo.com
Fri Aug 1 13:01:33 PDT 2008
"Steven Schveighoffer" wrote
> "Walter Bright" wrote
>> http://www.reddit.com/comments/6u7k0/sharing_in_d/
>
> There are 2 problems I see with this scheme.
>
> First, that the default is 'unshared'. This is going to break a lot of
> existing code, and make peoples lives miserable who do not want to deal
> with unshared non-stack data. I would hazard to guess that adopting this
> would cause a larger rift than const.
After thinking about this some more, I realize that this part of my argument
is wrong. I was thinking since by default you can share data today, that
should be the default. But most of the time, you declare things (global or
otherwise) expecting them not to be shared. Shared data is usually wrapped
in an object that you can synchronize on.
So most existing code should work fine unless that code expects to share
data with other threads.
That being said, I still see issues with casting and with function calling.
-Steve
More information about the Digitalmars-d
mailing list