Something needs to happen with shared, and soon.

David Nadlinger see at klickverbot.at
Thu Nov 15 15:05:40 PST 2012


On Thursday, 15 November 2012 at 22:57:54 UTC, Andrei 
Alexandrescu wrote:
> On 11/15/12 1:29 PM, David Nadlinger wrote:
>> On Wednesday, 14 November 2012 at 17:54:16 UTC, Andrei 
>> Alexandrescu wrote:
>>> That is correct. My point is that compiler implementers would 
>>> follow
>>> some specification. That specification would contain 
>>> informationt hat
>>> atomicLoad and atomicStore must have special properties that 
>>> put them
>>> apart from any other functions.
>>
>> What are these special properties? Sorry, it seems like we are 
>> talking
>> past each other…
>
> For example you can't hoist a memory operation before a shared 
> load or after a shared store.

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.

But still, you can't move memory operations across any other 
arbitrary function call either (unless you can prove it is safe 
by inspecting the callee's body, obviously), so I don't see where 
atomicLoad/atomicStore would be special here.

David


More information about the Digitalmars-d mailing list