Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dual core question
Message
From
19/05/2007 11:10:12
 
 
To
18/05/2007 15:03:07
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01226293
Message ID:
01227038
Views:
31
>>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
Map
View

Click here to load this message in the networking platform