lock down processor affinity.

This commit is contained in:
zeromus 2009-02-07 03:54:42 +00:00
parent 0bf9abd12f
commit bd6706e65f
3 changed files with 4 additions and 0 deletions

View File

@ -252,6 +252,7 @@ void OAKRA_Module_OutputDS::beginThread() {
threadData = new ThreadData();
((ThreadData *)threadData)->ds = this;
HANDLE updateThread = CreateThread(0,0,updateProc,threadData,0,&updateThreadId);
SetThreadAffinityMask(updateThread,1);
SetThreadPriority(updateThread,THREAD_PRIORITY_TIME_CRITICAL);
//SetThreadPriority(updateThread,THREAD_PRIORITY_HIGHEST);
}

View File

@ -557,6 +557,8 @@ void initDirectories()
#include "x6502.h"
int main(int argc,char *argv[])
{
SetThreadAffinityMask(GetCurrentThread(),1);
printf("%08x",opsize);
char *t;

View File

@ -1490,6 +1490,7 @@ static int fceu_exec_time(lua_State *L)
goEvent = CreateEvent(0,true,false,0);
DWORD threadid;
HANDLE thread = CreateThread(0,0,fceu_exec_time_proc,(LPVOID)L,0,&threadid);
SetThreadAffinityMask(thread,1);
//wait for the lua thread to start
WaitForSingleObject(readyEvent,INFINITE);
ResetEvent(readyEvent);