PEP 418: QueryPerformanceCounter() has a known bug

This commit is contained in:
Victor Stinner 2012-03-29 01:11:16 +02:00
parent c0a8e14174
commit 1590fd155a
1 changed files with 16 additions and 5 deletions

View File

@ -240,15 +240,21 @@ High-resolution performance counter. It is monotonic.
QueryPerformanceFrequency() gives its frequency.
On Windows XP, QueryPerformanceFrequency() is the processor frequency and
QueryPerformanceCounter() is the TSC of the current processor. Windows XP
had a bug (see `KB896256 <http://support.microsoft.com/?id=896256>`_): on a
multiprocessor computer, QueryPerformanceCounter() returned a different value
for each processor.
QueryPerformanceCounter() is the TSC of the current processor.
The performance counter value may unexpectedly leap forward because of a
hardware bug, see the `KB274323`_.
Windows XP had a bug (see `KB896256`_): on a multiprocessor computer,
QueryPerformanceCounter() returned a different value for each processor.
QueryPerformanceFrequency() should only be called once: the frequency will not
change while the system is running. It fails if the installed hardware does not
support a high-resolution performance counter.
.. _KB896256: http://support.microsoft.com/?id=896256
.. _KB274323: http://support.microsoft.com/?id=274323
Windows: GetTickCount(), GetTickCount64()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -428,7 +434,12 @@ static variable, it might be interesting to use this to make sure that the
values returned are indeed monotonic.
* Virtual machines provide less reliable clocks.
* QueryPerformanceCounter() had a bug in 2006 on multiprocessor computers
* QueryPerformanceCounter() has two known bugs:
`KB896256`_ (fixed) and `KB274323`_
Python may only workaround a specific known operating system bug: `KB274323`_
contains a code example to workaround the bug (use GetTickCount() to detect
QueryPerformanceCounter() leap).
Footnotes