Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to start another session of VFP on another core
Message
 
 
À
14/03/2008 11:20:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01301823
Message ID:
01302190
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform