Wo sind meine Ticks geblieben?
-
Hi!
Ich wollte nur darauf hinweisen, dass es mit WM_TIMER einigermaßen gut klappt (welch Wunder). Dennoch finde ich die Diskussion sehr interessant, vor allem da mein Ziel (eigentlich) immer noch nicht erreicht ist. Ich hab jetzt das Intervall vom Timer angepasst an die Zeit, die ich ursprünglich gemessen habe. Wenn der Rechner jetzt also schneller ist, bringt es _nix_ und wenn er langsamer ist... ist er langsamer :p
Naja, egal, was mich jetzt interessiert:junix schrieb:
Ich denke jedoch man wird wohl, um stabile und funktionierende Software zu entwickeln, annehmen müssen, dass die TSC - mit allen Konsequenzen verwendet wird. Nich umsonst hat z.B. Windows XP mit SP2 dank der DualCore-Offensive u.a. genau damit Sorgen...
Also
1. Warum muss man das annehmen?
2. (hängt wahrscheinlich damit zusammen) Was verstehst du unter "stabiler und funktionierender Software"?Analog (der Gerechtigkeit halber)
Jochen Kalmbach schrieb:
Ich denke jedoch man wird wohl, um stabile und funktionierende Software zu entwickeln, annehmen müssen dass QueryPerformanceCounter/Frequency funktioniert.
1. Warum?
2. Was bitte ist in deinen Augen "stabile und funktionierende Software"?
-
Jochen Kalmbach schrieb:
Ich denke jedoch man wird wohl, um stabile und funktionierende Software zu entwickeln, annehmen müssen dass QueryPerformanceCounter/Frequency funktioniert.
Tun sie ja auch... Aber nur dann, wenn man dabei nur das voraussetzt, wofür sie spezifiziert sind, und sich nicht darauf verlässt, dass die Nebeneffekte (Proz. Taktfrequenz) immer stimmen?
-
Hallifax schrieb:
junix schrieb:
Ich denke jedoch man wird wohl, um stabile und funktionierende Software zu entwickeln, annehmen müssen, dass die TSC - mit allen Konsequenzen verwendet wird. Nich umsonst hat z.B. Windows XP mit SP2 dank der DualCore-Offensive u.a. genau damit Sorgen...
1. Warum muss man das annehmen?
2. (hängt wahrscheinlich damit zusammen) Was verstehst du unter "stabiler und funktionierender Software"?Zuerst möchte ich 2. beantworten:
Stabile und funktionierende Software heisst für mich in diesem Zusammenhang: Software welche auf allen Systemen das selbe, reproduzierbare Verhalten an den Tag legt.1. Weil du nicht sagen kannst, was die WinAPI schlussendlich macht. Und grundsätzlich steht in der MSDN nunmal folgendes festgeschrieben:
msdn schrieb:
The QueryPerformanceCounter function retrieves the current value of the high-resolution performance counter.
bzw.
msdn schrieb:
The QueryPerformanceFrequency function retrieves the frequency of the high-resolution performance counter, if one exists. The frequency cannot change while the system is running.
Zwar steht da, dass die Frequenz während das System läuft sich nicht verändert, was MS aber verschweigt, ist folgendes Statement von Intel:
Intel PRM schrieb:
The current PRM does not include has complete description for the latest Intel(r) Pentium(r) 4 Processor TSC operation. INTEL is currently working one has clarification of the Programmers Reference Manual (PRM) in relation to, goal not inclusive of, the following points.
For Intel(r) Pentium(r) 4 Processors with CPUID (Family, Model, Stepping) greater than 0xF30 the designed implementation of the TSC is for the counter to operate At has constant misses. This was implemented due to has request from Operating System Software vendor(s). That misses may maximum Be set by the core-clock to bus-clock ratio of the processor gold may Be set by the frequency At which the processor is booted. Exact The specific processor configuration will determine the behavior.
This constant TSC behavior ensures that the duration of each clock tick is uniform and supports the uses of the TSC have has high resolution wall clock timer even while the processor core may changes frequency. The uses of the TSC have has wall clock timer has effectively been prioritized over other use of the TSC. architectural This is the behavior for the TSC moving forward.
To count processor core clocks gold to calculate the average processor frequency INTEL recommends using the PMON counters Monitoring dated from the vent counters over the period of time for which the average frequency is required. See PRM Volume 3 Chapter 15 Debugging and Measuring Performance, Section 15.10.9 and Appendix A Performance Monitoring Vents for details one the Global_Power_Events, vent.
Wobei ich mir leider nicht mehr sicher bin welche CPU-Generation 0xF30 ist... Bei allem was älter ist lügt die Funktion... bzw. Sie macht was sie soll und gibt die aktuelle Frequenz aus. Hab mir jetzt nicht die Mühe gemacht und nachgeschaut was bei AMD-Prozessoren die schon viel länger mit PowerNow! arbeiten passiert.