Something needs to happen with shared, and soon.

Peter Alexander peter.alexander.au at gmail.com
Tue Nov 13 14:07:45 PST 2012


On Tuesday, 13 November 2012 at 21:56:21 UTC, Andrei Alexandrescu 
wrote:
> On 11/13/12 1:28 PM, Walter Bright wrote:
>> On 11/13/2012 1:11 AM, luka8088 wrote:
>>> This clarifies a lot, but still a lot of people get confused 
>>> with:
>>> http://dlang.org/faq.html#shared_memory_barriers
>>> is it a faq error ?
>>
>> Andrei is a proponent of having shared to memory barriers, I 
>> disagree
>> with him. We haven't convinced each other yet, so this is a 
>> bit up in
>> the air.
>
> Wait, then what would shared do? This is new to me as I've 
> always assumed you and I have the same view on this.
>
> Andrei

I'm speaking out of turn, but...

I'll flip that around: what would shared do if there were memory 
barriers?

Walter has said previously in this thread that shared is to be 
used to mark shared data, and disallow any potentially 
non-thread-safe operations. To use shared data, you need to 
manually lock it and then cast away the shared temporarily. This 
can be made more pleasant with library utilities.



More information about the Digitalmars-d mailing list