Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atomic read-modify-write in C#

I've seen a couple of places quoting the following bit of the C# spec: "Aside from the library functions designed for that purpose, there is no guarantee of atomic read-modify-write." Can somebody point me to these library functions?

like image 650
David Moles Avatar asked Jul 11 '26 21:07

David Moles


1 Answers

The Interlocked class should provide you with what you are looking for; such as Increment and Decrement.

like image 170
Aaron McIver Avatar answered Jul 14 '26 11:07

Aaron McIver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!