TGE v1.4.x using one CPU
by Samme Ng · in Torque Game Engine · 07/11/2008 (9:03 pm) · 2 replies
I have problem running TGE in Duo Core CPU system.
As the program started, it running slowly, I profile them noticed that some very simple routine using quite a lot of time to finish. However, after several minute of time, the game running normally, the routine calling time become normal. In this situation, the program is using 2 CPUs.
If we disable one CPU using during the program started up in Task Manager, the program running normally as in non-duo-core system.
I heard a news that Half Life earlier version also suffer in this problem, they asked player to switch off one CPU in playing.
But I found an interesting thing, TGE newer version only using one CPU by default, making it run smooth in any kind of CPU.
My TGE version is 1.2 (quite old, however, being modified a lot by me and new update), and the 1.3 demo also using 2 CPUs by default. HOWEVER, the v1.4.2 using ONE CPU! I have looked around what compilation, linking options differences between 1.4.2 and mine, but nothing special!
So, I would like to ask if someone, can point out HOW, to make my v1.2 using ONE CPU?
Thanks a lot!
As the program started, it running slowly, I profile them noticed that some very simple routine using quite a lot of time to finish. However, after several minute of time, the game running normally, the routine calling time become normal. In this situation, the program is using 2 CPUs.
If we disable one CPU using during the program started up in Task Manager, the program running normally as in non-duo-core system.
I heard a news that Half Life earlier version also suffer in this problem, they asked player to switch off one CPU in playing.
But I found an interesting thing, TGE newer version only using one CPU by default, making it run smooth in any kind of CPU.
My TGE version is 1.2 (quite old, however, being modified a lot by me and new update), and the 1.3 demo also using 2 CPUs by default. HOWEVER, the v1.4.2 using ONE CPU! I have looked around what compilation, linking options differences between 1.4.2 and mine, but nothing special!
So, I would like to ask if someone, can point out HOW, to make my v1.2 using ONE CPU?
Thanks a lot!
#2
07/13/2008 (7:13 am)
I'm glad that you found this solution! If anyone else asks, I'll make sure to let them know about it.
Torque Owner Samme Ng
class WinTimer { private: U32 mTickCountCurrent; U32 mTickCountNext; S64 mPerfCountCurrent; S64 mPerfCountNext; S64 mFrequency; bool mUsingPerfCounter; public: WinTimer() { [B]SetProcessAffinityMask( GetCurrentProcess(), 1 );[/B]The SetProcessAffinityMask is doing what I wanted, and this code only occur in v1.4.2.
Although there aren't lot of people using old TGE version, I hope this can help someone suffer in this problem.