mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-24 05:25:21 +00:00
Implement set_ideal_processor_core (linux)
This commit is contained in:
parent
9e0b881b2b
commit
dbc9bdfe02
2 changed files with 6 additions and 0 deletions
|
@ -1916,6 +1916,11 @@ void thread_ctrl::set_ideal_processor_core(int core)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HANDLE _this_thread = GetCurrentThread();
|
HANDLE _this_thread = GetCurrentThread();
|
||||||
SetThreadIdealProcessor(_this_thread, core);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,6 +394,7 @@ namespace rsx
|
||||||
|
|
||||||
// Raise priority above other threads
|
// Raise priority above other threads
|
||||||
thread_ctrl::set_native_priority(1);
|
thread_ctrl::set_native_priority(1);
|
||||||
|
thread_ctrl::set_ideal_processor_core(0);
|
||||||
|
|
||||||
// Round to nearest to deal with forward/reverse scaling
|
// Round to nearest to deal with forward/reverse scaling
|
||||||
fesetround(FE_TONEAREST);
|
fesetround(FE_TONEAREST);
|
||||||
|
|
Loading…
Add table
Reference in a new issue