View Single Post
Old May 21st, 2008   #11 (permalink)
KillerShots
War Games coder
 
KillerShots's Avatar
 
Join Date: Apr 2001
Location: Florida
Posts: 1,917
In general, you will get much better performance if you let the OS decide which core or CPU to run on. It also makes coding a bit easier as you simply don't have to worry about it.

For most developers, threading was simply a methodology of being able to do stuff while I/O was going on... it was always flawed, but it was all they could see because they never owned or had access to multi-CPU machines. On a single-CPU/core machine, that's really all that threading does for you.

On the other hand... things just don't work that way any more. Hardly anyone has a single-core machine. Consequently, you can now use threading to do simultaneous non-I/O related tasks that are truly simultaneous (as long as the data they're working on fits in the cache of the core they're working on, or cache updates never happen simultaneously).

At any rate, back to the original point, in general the OS does a good job of distributing active threads across idle CPUs. Some OS's do a much better job of this (Sun, for example... been doing large CPU arrays for decades)... and this is one of the few things that at an OS level, MS does better than linux (linux does not support threads, only LWPs (Light-Weight Processes) masquerading as threads).
__________________
Primary
CPU: Athlon 64 X2 4400+ Mobo: Biostar N4SLI-A9 RAM: 2G Crucial (DDR400) Video: eVGA GeForce 7900 GTX (512M) Audio: HDA X-Mystique HD(s): Maxtor 300G SATA2, Samsung 400G SATA2 OS(s): WinXP x64 Pro, Vista x32 Ultimate, Gentoo x64 Monitor(s): Primary - 19" Flat Panel (1280x1024) Secondary - 19" Flat Panel (1280x1024) Tertiary - Zenith 42" Plasma TV (1024x768 res)

Many other machines... sig too short
KillerShots is offline   Reply With Quote