core.stdc.stdatomic

claptrap clap at trap.com
Thu Nov 16 22:50:30 UTC 2023


On Thursday, 16 November 2023 at 04:25:52 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
>>
>> But GC or not doesn't answer the main question, what LF 
>> algorithm depends on a a sequence of instructions being done 
>> immediately after a CAS? How do you ever enforce that on x86?
>
> That's the fun part, you can't enforce it on any ISA.

I know, that's the point, you have zero timing guarantees since 
your instructions can be interrupted at any point. So any 
algorithm relying on "timing" is doomed to fall".

IE, it makes no difference if the CAS is inline or wrapped in a 
function call.

LF algorithms rely on a sequence of operations being done in a 
specific order, and that order being coherent across 
cores/threads.



More information about the Digitalmars-d mailing list