Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to start another session of VFP on another core
Message
From
14/03/2008 12:23:10
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01301823
Message ID:
01302191
Views:
15
I just did a little (CPU-intensive) test while I had the task-manager open.

Lennert

>How do you monitor which Core it is using?
>
>John
>
>>Christian,
>>
>>Thank you for your code. It works correct. I see that this bitwise-or was the thing I missed. I gave as an argument 3 and was surprised the program still run at Core 0.
>>
>>Lennert
>>>Hello,
>>>
>>>if you can alter the code of the VFP app you can use a few API functions.
>>>
>>>
>>>&& main APP commandline
>>>LPARAMETERS ...., lcCPU
>>>
>>>IF VARTYPE(m.lcCPU) = 'C' AND VAL(m.lcCPU) != 0
>>> DECLARE INTEGER GetCurrentProcess IN WIN32API
>>> DECLARE INTEGER SetProcessAffinityMask IN WIN32API INTEGER hProcess, ;
>>>  INTEGER dwProcessAffinityMask
>>>&& lcCPU should be set to a bitwise OR of the processors on
>>>&& which the process should run (e.g. CPU 1 (1st bit) AND CPU 3 (3rd bit) =
>>>&& (1 + 8) = 9)
>>> SetProcessAffinityMask(GetCurrentProcess(),VAL(m.lcCPU))
>>>ENDIF
>>>
>>>
>>>Regards
>>>Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform