无符号互锁读取(Unsigned Interlocked Reads)

编程入门 行业动态 更新时间:2024-10-17 00:21:57
符号互锁读取(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不符合CLS

The 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

更多推荐

本文发布于:2023-08-07 07:26:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1462703.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:符号   互锁   Unsigned   Interlocked   Reads

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!