Ye olde code tippes

posted in Archipelago
Published December 07, 2007
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.
Previous Entry Modifiably mayhem
Next Entry Blender
0 likes 2 comments

Comments

Comments are shown oldest first so the discussion reads top to bottom.
NineYearCycle
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
December 07, 2007 08:34 AM
MGB
MGB
Ah, thanks for the link :)
...although the frequency information on that page seems to contradict itself somewhat?
December 07, 2007 08:40 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!

Latest Entries

Unity raytracer

2972 views

Well well well...

2535 views

Skweeny

3067 views

M&B

2121 views

Into the shadows...

2338 views

Cheap frills

2126 views