How can I make full use of my Quad-Core CPU?

Just starting out? Need help? Post your questions and find answers here.
the_off_topic_guy
User
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?

Post by the_off_topic_guy »

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?
The Off Topic Guy strikes back, if you dared to stop his hack...
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

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.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

You can play WoW and Quake at the same time ... while rendering a 3ds max scene.
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Use as much as threads as possible. :) but this makes code even not more stable an readable.
Tranquil
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

The Core 2 Extreme QX6700 runs at 2.66GHz on a 1066MHz front-side bus, which isn't too impressive IMO, specially for that price. And it doesn't have 4 cpu's, it has 2 dies that contains 2 cores each, in total 4 cores ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

You can learn here how to implement efficent threading algo, this is not the easiest task to code.
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Trond wrote:You can play WoW and Quake at the same time ... while rendering a 3ds max scene.
He better have 4 gfx cards too =)
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

He could put a REPEAT FOREVER loop into 3 threads and program his game in the other thread, then balance a kettle on his heatsink and boil some water to make a coffee. :)
the_off_topic_guy
User
User
Posts: 24
Joined: Fri Dec 08, 2006 5:15 pm
Location: Off Topic

Post by the_off_topic_guy »

dracflamloc wrote:
Trond wrote:You can play WoW and Quake at the same time ... while rendering a 3ds max scene.
He better have 4 gfx cards too =)
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 technology :P)...

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...
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

Doesn't the graphics card have to be the same model? :arrow:
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
kinglestat
Enthusiast
Enthusiast
Posts: 746
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Post by kinglestat »

I guess just use vista , read this forum with ie7 and play solitaire. Should use the cpus to the max ;) If you have any left over just use ms outlook to write an email with an attachment!!

cheers

KingLestat
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

> Its tough to sync that kind of thing but have fun!
Beep! Have you ever heard the word 'Mutex'? :wink:
PB 4.30

Code: Select all

onErrorGoto(?Fred)
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

GeoTrail wrote:Doesn't the graphics card have to be the same model? :arrow:
If you're using SLI. But that won't help him play 4 games at once. He needs 4 independant cards with 4 displays to do that =)
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

And probably 4 mice, 4 keyboards, 8 hands and 4 heads.
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Well that would certainly help but I can't assume EVERYONE is as 1337 as I am ;)
Post Reply