Something needs to happen with shared, and soon.

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Nov 15 17:55:55 PST 2012


On 11/15/12 3:30 PM, David Nadlinger wrote:
> On Thursday, 15 November 2012 at 23:22:32 UTC, Sean Kelly wrote:
>> On Nov 15, 2012, at 3:05 PM, David Nadlinger <see at klickverbot.at> wrote:
>>> Well, to be picky, that depends on what kind of memory operation you
>>> mean – moving non-volatile loads/stores across volatile ones is
>>> typically considered acceptable.
>>
>> Usually not, really. Like if you implement a mutex, you don't want
>> non-volatile operations to be hoisted above the mutex acquire or sunk
>> below the mutex release. However, it's safe to move additional
>> operations into the block where the mutex is held.
>
> Oh well, I was just being stupid when typing up my response: What I
> meant to say is that you _can_ reorder a set of memory operations
> involving atomic/volatile ones unless you violate the guarantees of the
> chosen memory order option.
>
> So, for Andrei's statement to be true, shared needs to be defined as
> making all memory operations sequentially consistent. Walter doesn't
> seem to think this is the way to go, at least if that is what he is
> referring to as »memory barriers«.

Shared must be sequentially consistent.

Andrei




More information about the Digitalmars-d mailing list