Windows XP 上的 _InterlockedCompareExchange64 编译器固有的?
根据 Microsoft 文档,直到 Windows Vista 之前,InterlockedCompareExchange64 才可用作 Windows API 调用。请参阅 http://msdn.microsoft .com/en-us/library/windows/desktop/ms683562(v=vs.85).aspx。
但是,只要您使用 Pentium 或更高版本的处理器,_InterlockedCompareExchange64 编译器内在函数似乎就可以在 Windows XP 上使用: http://msdn.microsoft.com/en-us/library/ttk2z1ws(VS.80).aspx 。
这是正确的吗?有什么问题吗?
Based on the Microsoft documentation InterlockedCompareExchange64 is not available as a Windows API call until Windows Vista. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683562(v=vs.85).aspx.
However, it seems like the _InterlockedCompareExchange64 compiler intrinsic might be available on Windows XP as long as you are using a Pentium or above processor: http://msdn.microsoft.com/en-us/library/ttk2z1ws(VS.80).aspx .
Is this correct? Is there any gotcha there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文档非常一致。 API 函数自 Vista 或 Server 2003 起可用,但如果您更喜欢内部函数(不需要外部 API),MS 编译器将通过特定的 CPU 指令实现该函数(请参阅 备注):
请注意,该指令可能是非常旧的 CPU 的问题。这意味着,如果您在 486 处理器上运行应用程序,一旦遇到此代码,它就会崩溃。
The documentation is quite consistent. API function is available since Vista or Server 2003, but if you prefer an intrinsic (that is no extrernal API required) MS compiler will implement the function through specific CPU instruction (see Remarks):
It is noted that this instruction might be an issue with very old CPUs. This means that if you run your app on 486 processor, it will just crash as soon as it stumbles on this code.