Processor affinity settings fails for a process


  • Hi,

    I'm using Visual Studio .net 2008 Test edition under Windows Server 2008 x64 to run load test on my firm's website. The test machine has 8 processors and 16 Go RAM so hardware shouldn't be the limiting factor.

    When I launch load tests from VS .net, a new process named VSTestHost *32  is fired and proceed to web requests. The default affinity for this (.net 2.0) process is only 1 processor and it quickly get stuck to 100%.
    When I try to set the affinity to all 8 processor using taskmanager tool, the operation silently fails and the process remains always bound to the single first CPU.

    I then tried to run this process with MSTest.exe *32 (command line tool to do the same job) using the "start" DOS function to use the /affinity parameter. Giving for instance /affinity 3 should autorize the process MSTest.exe *32 to use CPU0 and CPU1 but it doesn't work.

    Is there a particular concern with running x32 process on x64 OS with .net 2.0 framework ? how could i achieve to allow all processors for VSTestHost *32 or MSTest.exe *32 processes ?

    PS: I can set all other running process affinity without problem and I'm in windows server administrator role.

    Thanks for your help .
    Freitag, 21. März 2008 15:30


  • Hi,


    According to the following MSDN document, a 32bit application should be able to access up to 32 processors via the WOW64 environment in a x64 operating system.


    “While 64-bit Windows supports a maximum of 64 processors, 32-bit Windows supports a maximum of 32 processors. Therefore, functions such as GetProcessAffinityMask simulate a computer with 32 processors when called under WOW64. The affinity mask is obtained by performing a bitwise OR operation of the top 32 bits of the mask with the low 32 bits. Therefore, if a thread has affinity for processors 0, 1, and 32, WOW64 reports the affinity as 0 and 1, because processor 32 maps to processor 0. Functions that set processor affinity, such as SetThreadAffinityMask, restrict processors to the first 32 processors under WOW64.”



    However, as this issue happens on two custom applications, it seems to be a development related issue. We recommend you posting in the MSDN forum so that you will get the most qualified support of these tools. For your reference, I have included the link to MSDN forum below:


    MSDN Forum


    Hope the issue will be resolved soon.



    Montag, 31. März 2008 10:17