无符号互锁读取(Unsigned Interlocked Reads)
Interlocked.Read()背后的原因是什么只是为Int64定义而不是为UInt64定义? 我不会想到这两种类型之间有任何区别。
What is the reasoning behind Interlocked.Read() only being defined for Int64 and not for UInt64? I wouldn't have thought there was any difference between the two types.
最满意答案
Interlocked类在mscorlib中定义,它是符合CLS的,而UInt32和UInt64 ,无论好坏,都不符合CLS。
至于为什么它们不符合CLS,请参阅此SO文章:
为什么unsigned int不符合CLSThe Interlocked class is defined in mscorlib which is CLS-Compliant and UInt32 and UInt64 are, for better or for worse, not CLS-Compliant.
As for why they are not CLS-Compliant, see this SO article:
Why are unsigned int's not CLS compliant更多推荐
发布评论