reflectronic
reflectronic
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
a Volatile write has “release semantics,” it means that any operations which were written before the write in the code must stay before the write. it is a useful property for… releasing a lock
23 replies
CC#
Created by yeon on 4/16/2025 in #help
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
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
the CPU and the compiler are allowed to execute memory reads and writes in a different order than the one which you wrote in the program
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
it is about the ordering of memory operations
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
the volatile is not about the atomicity
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
all of the interlocked methods are a full barier
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
yes, your lock looks fine
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
the volatile is a release, the interlocked is a full barrier. so nothing can move outside
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
all of the memory operations will complete before the flag is cleared
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
the compare exchange and volatile write ensures the memory operations do not fall outside of the lock
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
you mean, if you call RefreshLobbies twice in a row?
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
i am not sure what you mean by "if Interlocked.CompareExchange returns zero, the memory operations should be visible." if it returns zero, the memory operations haven't happened yet
23 replies
CC#
Created by yeon on 4/16/2025 in #help
Mixing `Volatile` with `Interlocked`
yes, it is fine to mix them like that
23 replies
CC#
Created by Oleander on 4/14/2025 in #help
Native AOT Shared Library - Correct Typing for Struct Pointer Parameter
why can't you do retro_system_info* info?
5 replies
CC#
Created by SpaceCat on 4/13/2025 in #help
.NET generate assets for build and debug not apperaring
you go into the "Problems" window and it tells you what the problems are
46 replies
CC#
Created by SpaceCat on 4/13/2025 in #help
.NET generate assets for build and debug not apperaring
for the second one, it generally means there is a problem with your code that you need to fix
46 replies
CC#
Created by SpaceCat on 4/13/2025 in #help
.NET generate assets for build and debug not apperaring
No description
46 replies
CC#
Created by SpaceCat on 4/13/2025 in #help
.NET generate assets for build and debug not apperaring
well. i don't see how the two pictures are related to each other
46 replies
CC#
Created by SpaceCat on 4/13/2025 in #help
.NET generate assets for build and debug not apperaring
can you show your vs code window
46 replies