On Tue Jul 4 16:08:22 2023 +0000, Rémi Bernon wrote:
I think so, as the access is neither volatile nor atomic the compiler has more freedom into its optimisations and may perhaps move the comparison out of the loop (although the atomic operation next to it on the same variable might prevent it). I usually prefer to avoid non-atomic accesses on variables that are used for synchronization altogether to avoid this kind of potential pitfall.
It could probably be `ReadNoFence` instead of `InterlockedOr`, I always forgot the name of that intrinsic.