Something needs to happen with shared, and soon.

Sean Kelly sean at invisibleduck.org
Thu Nov 15 08:23:45 PST 2012


On Nov 14, 2012, at 6:28 PM, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:

> On 11/14/12 4:50 PM, Sean Kelly wrote:
>> On Nov 14, 2012, at 2:25 PM, Andrei
>> Alexandrescu<SeeWebsiteForEmail at erdani.org>  wrote:
>> 
>>> On 11/14/12 1:09 PM, Walter Bright wrote:
>>>> Yes. And also, I agree that having something typed as "shared"
>>>> must prevent the compiler from reordering them. But that's
>>>> separate from inserting memory barriers.
>>> 
>>> It's the same issue at hand: ordering properly and inserting
>>> barriers are two ways to ensure one single goal, sequential
>>> consistency. Same thing.
>> 
>> Sequential consistency is great and all, but it doesn't render
>> concurrent code correct.  At worst, it provides a false sense of
>> security that somehow it does accomplish this, and people end up
>> actually using it as such.
> 
> Yah, but the baseline here is acquire-release which has subtle differences that are all the more maddening.

Really?  Acquire-release always seemed to have equivalent safety to me.  Typically, the user doesn't even have to understand that optimization can occur upwards across the trailing boundary of the block, etc, to produce correct code.  Though I do agree that the industry is moving towards sequential consistency, so there may be no point in trying for something weaker.


More information about the Digitalmars-d mailing list