Environment versions
Network:
Windows 2000 Server
>>Start the task manager. In the "Precesses" tab right click on some process running, some of the last context menu items is "select affinity". Almost all processes will have cpu 0 and cpu 1 checked. You can force one of your exe runs on one cpu, the other on the second. But normally it's the job of the OS to balance cpu usage and it might get the idea, that your two exes will run best on seperate cores. I think you're better at leaving both cpu's checked, but just give it a try and see what's faster.
>>
>As Olaf already explained the manual version in greater detail than I would have, let me just add that there are WINAPI calls (get/set process/thread affinitymask) which should do the same programmatically.
>
>HTH
>
>thomas
Thanks, I still needed a little search, which concludes like this: Use CreateProcess to create a process, in a PROCESS_INFORMATION structure you can get the Process- and Thread- -handle and -id. The process handle hProcess is then an input parameter for SetProcessAffinityMask.
So for just experimenting, if it works and if the process times are long enough, I'd create a form with a button starting the lenghty processing. Then start both EXEs manually, set their CPU affinity manually and then click both start buttons. Good enough to get a rough estimate. And if you have sucess in getting better performance by setting affinity manually you can find out how to do it programmatically.
Bye, Olaf.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only