reflectronic
Mixing `Volatile` with `Interlocked`
this code is implementing a lock. the write releases the lock. if the CPU or compiler chooses to take some of the code that yeon wrote “inside” of the lock and execute it after that release, you have a broken lock. someone could see the lock is released, and enter the lock, but the other thread is still editing the protected data structures
23 replies
Mixing `Volatile` with `Interlocked`
it is described in the memory model https://github.com/dotnet/runtime/blob/main/docs/design/specs/Memory-model.md
23 replies