core.stdc.stdatomic

claptrap clap at trap.com
Wed Nov 15 09:55:22 UTC 2023


On Wednesday, 15 November 2023 at 06:59:45 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> On 15/11/2023 7:33 PM, Walter Bright wrote:
>> I do not understand why a function that consists of a FENCE 
>> instruction will be a failure compared to a FENCE instruction 
>> inlined.
>
> Yes, ideally a memory barrier wouldn't matter for how it is 
> executed.
>
> But it does matter for load/cas. Because what was true when the 
> operation executed may not be true any longer by the time the 
> next operation is performed with deep calls in use.

That doesnt make any sense, the whole point of CAS is that it is 
atomic, immediately after it has completed you have no guarantees 
anyway, what difference does it make if it's wrapped in a 
function call?




More information about the Digitalmars-d mailing list