1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

Implement set_ideal_processor_core (linux)

This commit is contained in:
Nekotekina 2017-11-07 15:30:13 +03:00
parent 9e0b881b2b
commit dbc9bdfe02
2 changed files with 6 additions and 0 deletions

View File

@ -1916,6 +1916,11 @@ void thread_ctrl::set_ideal_processor_core(int core)
#ifdef _WIN32
HANDLE _this_thread = GetCurrentThread();
SetThreadIdealProcessor(_this_thread, core);
#else
cpu_set_t cs;
CPU_ZERO(&cs);
CPU_SET(core, &cs);
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cs);
#endif
}

View File

@ -394,6 +394,7 @@ namespace rsx
// Raise priority above other threads
thread_ctrl::set_native_priority(1);
thread_ctrl::set_ideal_processor_core(0);
// Round to nearest to deal with forward/reverse scaling
fesetround(FE_TONEAREST);