How can I make full use of my Quad-Core CPU?
-
- User
- Posts: 24
- Joined: Fri Dec 08, 2006 5:15 pm
- Location: Off Topic
How can I make full use of my Quad-Core CPU?
Hello!
I recently bought a Core 2 Extreme QX6700 and would like to know how can I make use of all 4 CPUs in my machine to make for example a small game.. What extra code do I need to use?
I recently bought a Core 2 Extreme QX6700 and would like to know how can I make use of all 4 CPUs in my machine to make for example a small game.. What extra code do I need to use?
The Off Topic Guy strikes back, if you dared to stop his hack...
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
You need to figure out 4 subsystems of your game to split onto threads.
You could probably do,
Core 1: Game Loop/Sound
Core 2: AI or Physics
Core 3: Rendering
Core 4: Seamless background loading of levels, textures, etc.
Its tough to sync that kind of thing but have fun!
Honestly in small games you spend more CPU and memory access time syncing the threads than you gain in speed. You also need to be careful because I'm pretty sure they usually share the same cache, which can make optimization a bit tougher, since 4 intense threads can easily lead to pipeline flushing and cache thrashing more often than a single thread might.
You could probably do,
Core 1: Game Loop/Sound
Core 2: AI or Physics
Core 3: Rendering
Core 4: Seamless background loading of levels, textures, etc.
Its tough to sync that kind of thing but have fun!
Honestly in small games you spend more CPU and memory access time syncing the threads than you gain in speed. You also need to be careful because I'm pretty sure they usually share the same cache, which can make optimization a bit tougher, since 4 intense threads can easily lead to pipeline flushing and cache thrashing more often than a single thread might.
You can learn here how to implement efficent threading algo, this is not the easiest task to code.
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
-
- User
- Posts: 24
- Joined: Fri Dec 08, 2006 5:15 pm
- Location: Off Topic
I have just 2 Graphic Cards (the other one is GeForce 7950 GX2 and the other one is 8800 GT, oh I love the SLi technologydracflamloc wrote:He better have 4 gfx cards too =)Trond wrote:You can play WoW and Quake at the same time ... while rendering a 3ds max scene.

Oh and don't ask for the price I spent for my PC... it was around 5000€.
The Off Topic Guy strikes back, if you dared to stop his hack...
-
- Enthusiast
- Posts: 746
- Joined: Fri Jul 14, 2006 8:53 pm
- Location: Malta
- Contact:
> Its tough to sync that kind of thing but have fun!
Beep! Have you ever heard the word 'Mutex'?
Beep! Have you ever heard the word 'Mutex'?

PB 4.30
Code: Select all
onErrorGoto(?Fred)
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact: