#include #include #include #include HANDLE ThreadHandles[32]; DWORD WorkerThread( PVOID ThreadIndex ) { DWORD Processor; BOOL DoSleep; Processor = (DWORD)ThreadIndex; if ( Processor > 100 ) { DoSleep = TRUE; Processor -= 100; } else { DoSleep = FALSE; } SetThreadAffinityMask(GetCurrentThread(),1 << Processor); for(;;){ if ( Processor & 1 ) { SetThreadPriority(ThreadHandles[Processor-1],THREAD_PRIORITY_ABOVE_NORMAL); SetThreadPriority(ThreadHandles[Processor-1],THREAD_PRIORITY_NORMAL); } else { if ( DoSleep ) { Sleep(0); } } } return 0; } int __cdecl main( int argc, char *argv[], char *envp[] ) { DWORD i; SYSTEM_INFO SystemInfo; DWORD ThreadId; HANDLE hThread; GetSystemInfo(&SystemInfo); if ( SystemInfo.dwNumberOfProcessors >= 3 ) { for ( i=0;i