Jump to content

  • Log In with Google      Sign In   
  • Create Account





Ye olde code tippes

Posted by Aph3x, 07 December 2007 · 173 views

Just found out a useful little fact.
When using the performance timer on multicore PC's you can get strange results if the timer thread gets swapped between CPU's. There are patches to fix this, but not everyone has them applied, leading to strange game behaviour or games not working on multicore CPUs.
The (recommended) solution is to use the windows SetThreadAffinityMask function to try and keep the thread running on the same cpu.




Well Yes and No to this one. There is an issue caused by using RDTSC directly on multi-core machines but simply forcing everything to use a single processor isn't a graceful way of handling it. This is generally the fix used for games which were designed for singlecore machines, I've used it to get Battlefield:1942 running for example.

Ah, I just realised that your actually talking about the solution proposed in this following article of generating time deltas in a main thread which is bound to one of the cores.

http://msdn2.microsoft.com/en-us/library/bb173458.aspx

Doh, ignore the first part :)

Andy
Ah, thanks for the link :)
...although the frequency information on that page seems to contradict itself somewhat?

December 2014 »

S M T W T F S
 123456
78910111213
141516171819 20
21222324252627
28293031   

Recent Entries

Recent Comments

Recent Entries

Recent Comments

Latest Visitors

PARTNERS