Skip to content
Discussion options

You must be logged in to vote

Not really feasible, IMO. You can certainly implement some form of "interlocked" data structures but due to the nature of the implementation, they would all (except sometimes CompareExchange) be implemented as expensive loops. Additionally, on 32-bit such operations get even worse and you can get into really odd behavior.

The most feasible thing is really to just expose Interlocked.CompareExchange that operates over 2x nint or 2x nuint. That can be atomic on both 32-bit and 64-bit and is more practically useful IMO.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@BreyerW
Comment options

@tannergooding
Comment options

Answer selected by BreyerW
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants