QueryPerformanceCounter状态? [英] QueryPerformanceCounter Status?

查看:378
本文介绍了QueryPerformanceCounter状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了一些关于QPC实现的问题和不准确性。但是所有这些讨论和文章似乎都过时了。



任何人都知道最新的Win7操作系统和Intel / AMD cpus上的QPC功能的当前状态是什么?有没有任何改进?例如Turbo Boost仍然是一个大问题?



我主要感兴趣的是,因为我需要决定使用timeGetTime和QueryPerformanceCounter在我的应用程序之间的计时。

$微软以前的老版软件方面(旧kb文章上的问题: http://support.microsoft.com/kb/895980 )。这个修补程序可以安装在任何目标系统上的心态(我看到一些游戏这样做),但它不应该需要。所有新的处理器都有硬件修复/补偿,以及TSC在内核之间正确同步,因此消除了基于 RDTSC 的定时器的问题。可以从此处获取修补程序: http://support.microsoft.com/?id=896256我不知道是否有任何其他系统,但从它的外观,这个修复是在Windows Vista和基于Windows 7的操作系统inheirent。至于准确性的问题,这取决于硬件本身,但Microsoft说,QPC是最可靠的精确计时器,你可以得到(体面的性能),因此缺乏内联 __ rdtsc(),我怀疑你会得到更准确的。


I've read some about the problems and inaccuracy of the QPC implementation. But all those discussions and articles seem rather out of date.

Anyone know what the current status is of the QPC functionality on the latest Win7 OS and Intel/AMD cpus? Has there been any improvements? Is e.g. Turbo Boost still a big issue?

I'm mainly interested in this since I need to decide between using timeGetTime and QueryPerformanceCounter for timing in my application.

解决方案

QPC was patched software side by microsoft ages ago (old kb article on the problem: http://support.microsoft.com/kb/895980 ). This fix can be installed on any target system for piece of mind (I've seen a few games doing this), however it shouldn't be needed. All newer processors have a hardware fix/compensation for this, as well as having the TSC correctly synced between cores, so the problems with RDTSC based timers are eliminated. The hot-fix can be gotten from here: http://support.microsoft.com/?id=896256 i'm not sure if there is anything for other systems, but from the looks of it this fix was inheirent in windows vista and windows 7 based OSes. As for the question of accuracy, that depends on the hardware itself, however Microsoft says QPC is the most reliably accurate timer you can get (with decent performance), so short of inline __rdtsc(), I doubt you'll get any more accurate.

这篇关于QueryPerformanceCounter状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆