core.stdc.stdatomic
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Fri Nov 17 04:12:32 UTC 2023
On 17/11/2023 11:50 AM, claptrap wrote:
> LF algorithms rely on a sequence of operations being done in a specific
> order, and that order being coherent across cores/threads.
Yes but there is a condition on this:
1. Each operation must be atomic, or:
2. Operate on an atomically synchronized memory
But most importantly:
3. Must be predictable
When you don't inline you get additional steps added that may not hold
this condition. Where it can be not atomic and not operating on
non-atomically synchronized memory.
This is why it matters that it doesn't inline. It adds variability
between the steps so that it isn't doing what you think the algorithm is
doing. It introduces unpredictability.
More information about the Digitalmars-d
mailing list