Is there an equivalent of the XADD command in .Net? This is, after all, the most efficient method of locking / checking locks for critical sections or for ensuring accurate increments in a multi-threaded environment.
I looked through the IL opcodes, but couldn’t find an equivalent.
The closest equivelent in .NET would be to use the Interlocked class. For example, you can use Interlocked.Add to have safe, accurate increments in a multi-threaded environment.