XP app won't increase cpu utilization
<p>I am trying to fix a problem with a legacy Visual Studio win32 un-managed c++ app which is not keeping up with input. As a part of my solution, I am exploring bumping up the class and thread priorities.</p>

<p>My PC has 4 xeon processors, running 64 bit XP. I wrote a short win32 test app which creates 4 background looping threads, each one running on their own processor. Some code samples are shown following. The problem is that even when I bump the priorities to the extreme, the cpu utilization is still less than 1%.</p>

<p>My test app is 32 bit, running on WOW64.  The same test app also utilizes less than 1% cpu utilization on a 32 bit xp machine. I am an administrator on both machines. What else do I need to do to get this to work?</p>

<pre><code>DWORD __stdcall ThreadProc4 (LPVOID)
{
    SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_TIME_CRITICAL);
    while (true)
    {
        for (int i = 0; i &lt; 1000; i++)
        {
            int p = i;
            int red = p *5;
            theClassPrior4 = GetPriorityClass(theProcessHandle);
        }
        Sleep(1);
    }
}

int APIENTRY _tWinMain(...)
{
...
    theProcessHandle = GetCurrentProcess();
    BOOL theAffinity = GetProcessAffinityMask(
        theProcessHandle,&amp;theProcessMask,&amp;theSystemMask);

    SetPriorityClass(theProcessHandle,REALTIME_PRIORITY_CLASS);

    DWORD  threadid4 = 0;
    HANDLE thread4   = CreateThread((LPSECURITY_ATTRIBUTES)NULL,
        0,
        (LPTHREAD_START_ROUTINE)ThreadProc4,
        NULL,
        0,
        &amp;threadid4);

    DWORD_PTR theAff4 = 8;
    DWORD_PTR theAf4 = SetThreadAffinityMask(thread1,theAff4);
    SetThreadPriority(thread4,THREAD_PRIORITY_TIME_CRITICAL);
    ResumeThread(thread4);
</code></pre>
