No memory model

qznc qznc at web.de
Tue Oct 22 02:07:36 PDT 2013


On Tuesday, 22 October 2013 at 00:26:48 UTC, deadalnix wrote:
> On Monday, 21 October 2013 at 20:50:28 UTC, qznc wrote:
>> As far as I google, D has not specified a memory model.
>>
>> However, I assume it should basically be the same as the C++ 
>> memory model: Sequential consistency for data-race-free 
>> programs.
>
> shared = sequential consistency.
> immutable = immutable.
> TL = do whatever you want to make my program faster.

So Ds shared has a similar effect as Javas volatile. The 
difference is transitivity like with const.

Nevertheless, core.atomic also plays into this. Why do we need 
atomicStore, if we have shared? Why does atomicStore require its 
argument to be shared?


More information about the Digitalmars-d mailing list