Jump to content

April 2017 »

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526 27 2829
30      

Recent Entries

Recent Comments

Recent Entries

Recent Comments

Latest Visitors

- - - - -

Ye olde code tippes



4: Adsense

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.

Dec 07 2007 02:34 AM
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
Dec 07 2007 02:40 AM
Ah, thanks for the link :)
...although the frequency information on that page seems to contradict itself somewhat?

Note: GameDev.net moderates comments.