What exactly shared means?

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jan 3 04:26:43 PST 2015


On Saturday, 3 January 2015 at 12:12:47 UTC, Ola Fosheim Grøstad 
wrote:
> On Saturday, 3 January 2015 at 10:13:52 UTC, John Colvin wrote:
>> The Java, C11 and C++11 memory model.
>
> Well...
>
> http://en.cppreference.com/w/cpp/atomic/memory_order

Ok, with the exception of relaxed atomics.

>
>> Yes, I was hoping that perhaps you knew more specifics. AFAIK, 
>> when not restricted by any kind of barriers, SC-DRF does not 
>> have a particularly significant cost.
>
> I think that even with lock free datastructures such as Intel 
> Threaded Building Blocks, you would still gain from using a 
> non-synchronizing API where possible. In real code you have 
> several layers for functioncalls, so doing this by hand will 
> complicate the code.

That isn't what I mean. I was talking about the restrictions that 
the memory model puts on optimising _all_ code, except where 
memory is provably unshared. Things like never creating a write 
where one would not have occurred in a sequentially consistent 
execution of the original source.


More information about the Digitalmars-d-learn mailing list