Semantics of shared

Robert Jacques sandford at jhu.edu
Wed May 13 23:01:21 PDT 2009


On Thu, 14 May 2009 01:27:15 -0400, Walter Bright  
<newshound1 at digitalmars.com> wrote:

> Robert Jacques wrote:
>> I don't see a place for "maybe shared" that isn't already handled by  
>> simply "shared".
>
> I gave a flip and incomplete answer there.
>
> I'm not sure there is even a point to a function that could handle both  
> shared and unshared with the same code. First of all, sharing is going  
> to need some sort of synchronization; you're going to try and minimize  
> the amount of code that has to deal with shared. I can't see trying to  
> run an in-place sort on a shared array, for example. Can you imagine two  
> threads trying to sort the same array?
>
> You're going to want to approach manipulating shared data differently  
> than unshared.

I agree for POD, but what classes where the synchronization is  
encapsulated behind a virtual function call?

Also, does this mean 'scope' as a type is going away?



More information about the Digitalmars-d mailing list