无符号联锁读取

发布于 2024-10-09 19:47:21 字数 75 浏览 13 评论 0 原文

仅为 Int64 而不是 UInt64 定义 Interlocked.Read() 背后的原因是什么?我没想到这两种类型之间有什么区别。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回眸一遍 2024-10-16 19:47:21

Interlocked 类在 mscorlib 中定义,即 符合 CLS 以及 UInt32UInt64 无论好坏,都不符合 CLS。

至于为什么它们不符合 CLS,请参阅这篇 SO 文章:

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:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文