Shared - Another Thread

Erik van Velzen erik at evanv.nl
Thu Oct 18 20:10:18 UTC 2018


On Thursday, 18 October 2018 at 19:09:42 UTC, Patrick Schluter 
wrote:
> On Thursday, 18 October 2018 at 16:24:39 UTC, Manu wrote:
>>
>> Elaborate on this... It's clearly over-ambitious if anything.
>> What issues am I failing to address? I'm creating a situation 
>> where using
>> shared has a meaning, is safe, and doesn't require any unsafe 
>> interactions,
>> no casts, etc, for users at any level above the bare metal 
>> tooling... How
>> would you improve on that proposition?
>
> No, your proposition is not the issue here. The problem I see 
> is the expectation people have with what shared is supposed to 
> do. I have the impression from reading in this forum about 
> shared that people expect that just putting a shared in front 
> of a variable will solve all the concurrency problems in 
> existance.

I think you hit the nail on the head here.

When shared stood up in its current form,  expectation was made 
"this will be threadsafe automatically - we'll figure out how in 
the future". Because it works for global variables. But it 
doesn't seem like an expectation we can deliver on.

(I have no direct reference to this but that was certainly my 
impression)

> Your proposition doesn't want to address this utopic goal and 
> that is a good thing imo. Adding that restriction that you 
> propose makes explicit what was implied but not clearly stated 
> until now.
> I'm not good enough in D to add more than a meta reflexion on 
> the subject so I will not follow up on that. I often have the 
> impression that a lot of things are going slower than necessary 
> because a mentality where the perfect is in the way of good.




More information about the Digitalmars-d mailing list