Let's say I had a program in C# that did something computationally expensive, like encoding a list of WAV files into MP3's. Ordinarily I would encode the files one at a time, but let's say I wanted the program to figure out how many CPU cores I had and spin up an encoding thread on each core. So, when I run the program on a quad core CPU, the program figures out it's a quad core CPU, figures out there's four cores to work with, then spawns four threads for the encoding, each of which is running on its own separate CPU. How would I do this?
And would this be any different if the cores were spread out across multiple physical CPU's? As in, if I had a machine with two quad core CPU's on it, are there any special considerations or are the eight cores across the two dies considered equal in Windows?