该System.Threading.Interlocked对象允许加法(减法)和比较作为原子操作.似乎只是不做相等的CompareExchange以及作为原子比较的GreaterThan/LessThan将是非常有价值的.
System.Threading.Interlocked
Interlocked.GreaterThanIL 的假设特征还是CPU级功能?都?
Interlocked.GreaterThan
缺少任何其他选项,是否可以用C++或直接IL代码创建这样的功能并将该功能公开给C#?
c# c++ il interlocked interlocked-increment
c# ×1
c++ ×1
il ×1
interlocked ×1
interlocked-increment ×1