Hopefully this is a better question than my previous. I have a .exe which I will be passing different parameters (file paths) to which it will then take in and parse. So I w
To answer your revised question, you want processes. You just need to create the correct number of processes running the exe. Don't worry about forcing them onto specific cores. Windows will do that automatically.
How to do this:
You want to determine the number of cores on the machine. You may simply know it, and hardcode it, or you might want to use something like System.Environment.ProcessorCount
.
Create a List<Process>
object.
Then you want to start that many processes using System.Diagnostics.Process.Start
. The return value will be a process object, which you will want to add to the List.
Now repeat the following until you are finished:
Call Thread.Sleep
to wait for a while. Perhaps a minute or so.
Loop through each Process
in the list but be sure to use a for
loop rather than a foreach
loop. For each process, call Refresh()
then check the 'HasExited' property of each process, and if it is true, create a new process using Process.Start
, and replace the exited process in the list with the newly created one.