@CrouchSoft said:
Ive just started playing around with the Source SDK to make a test Half-Life 2 mod. On occasions when i opened the mod the console reported rather odd CPU speeds.
Now im pretty sure i this is right: 2 CPUs, Frequency: 2.1 Ghz, Features: GenuineIntel SSE SSE2 MMX RDTSC CMOV FCMOV
Suddenly my CPU gained a huge boost in speed: 2 CPUs, Frequency: 27.2 Ghz, Features: GenuineIntel SSE SSE2 MMX RDTSC CMOV FCMOV
Then got rather slow: 2 CPUs, Frequency: -22926.5 Mhz, Features: GenuineIntel SSE SSE2 MMX RDTSC CMOV FCMOV
Ah, you're using a dual-core system. It's probably estimating the CPU speed using the TSC register, which records the number of clock ticks since the last reset. Unfortunately, on a dual core system each core has its own TSC, and while they start off roughly syncronised they gradually get out of sync as time passes for various reasons. When a process that uses the TSC register moves from one core to the other, you can get all sorts of interesting results. (Some Googling suggests that Speedstep tends to cause this sort of desync on Intel processors, and that AMD processors have more subtle causes of the issue. If you want something really interesting, you should see what happens if you accidentally force the Linux kernel to use the TSC for the system clock on a dual-core AMD chip...)