noone gets thread affinity controls
All checks were successful
eden-license / license-header (pull_request) Successful in 20s
All checks were successful
eden-license / license-header (pull_request) Successful in 20s
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
1484724ee9
commit
4150452f5a
3 changed files with 1 additions and 54 deletions
|
@ -33,56 +33,6 @@
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
|
|
||||||
void SetCurrentThreadPriority(ThreadPriority new_priority) {
|
|
||||||
auto handle = GetCurrentThread();
|
|
||||||
int windows_priority = 0;
|
|
||||||
switch (new_priority) {
|
|
||||||
case ThreadPriority::Low:
|
|
||||||
windows_priority = THREAD_PRIORITY_BELOW_NORMAL;
|
|
||||||
break;
|
|
||||||
case ThreadPriority::Normal:
|
|
||||||
windows_priority = THREAD_PRIORITY_NORMAL;
|
|
||||||
break;
|
|
||||||
case ThreadPriority::High:
|
|
||||||
windows_priority = THREAD_PRIORITY_ABOVE_NORMAL;
|
|
||||||
break;
|
|
||||||
case ThreadPriority::VeryHigh:
|
|
||||||
windows_priority = THREAD_PRIORITY_HIGHEST;
|
|
||||||
break;
|
|
||||||
case ThreadPriority::Critical:
|
|
||||||
windows_priority = THREAD_PRIORITY_TIME_CRITICAL;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
windows_priority = THREAD_PRIORITY_NORMAL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
SetThreadPriority(handle, windows_priority);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
void SetCurrentThreadPriority(ThreadPriority new_priority) {
|
|
||||||
pthread_t this_thread = pthread_self();
|
|
||||||
|
|
||||||
const auto scheduling_type = SCHED_OTHER;
|
|
||||||
s32 max_prio = sched_get_priority_max(scheduling_type);
|
|
||||||
s32 min_prio = sched_get_priority_min(scheduling_type);
|
|
||||||
u32 level = (std::max)(static_cast<u32>(new_priority) + 1, 4U);
|
|
||||||
|
|
||||||
struct sched_param params;
|
|
||||||
if (max_prio > min_prio) {
|
|
||||||
params.sched_priority = min_prio + ((max_prio - min_prio) * level) / 4;
|
|
||||||
} else {
|
|
||||||
params.sched_priority = min_prio - ((min_prio - max_prio) * level) / 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
pthread_setschedparam(this_thread, scheduling_type, ¶ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
// Sets the debugger-visible name of the current thread.
|
// Sets the debugger-visible name of the current thread.
|
||||||
|
|
|
@ -195,7 +195,6 @@ void CpuManager::RunThread(std::stop_token token, std::size_t core) {
|
||||||
name = "CPUThread";
|
name = "CPUThread";
|
||||||
}
|
}
|
||||||
Common::SetCurrentThreadName(name.c_str());
|
Common::SetCurrentThreadName(name.c_str());
|
||||||
Common::SetCurrentThreadPriority(Common::ThreadPriority::Critical);
|
|
||||||
auto& data = core_data[core];
|
auto& data = core_data[core];
|
||||||
data.host_context = Common::Fiber::ThreadToFiber();
|
data.host_context = Common::Fiber::ThreadToFiber();
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,7 @@ namespace VideoCommon::GPUThread {
|
||||||
static void RunThread(std::stop_token stop_token, Core::System& system,
|
static void RunThread(std::stop_token stop_token, Core::System& system,
|
||||||
VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context,
|
VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context,
|
||||||
Tegra::Control::Scheduler& scheduler, SynchState& state) {
|
Tegra::Control::Scheduler& scheduler, SynchState& state) {
|
||||||
std::string name = "GPU";
|
Common::SetCurrentThreadName("GPU");
|
||||||
|
|
||||||
Common::SetCurrentThreadName(name.c_str());
|
|
||||||
system.RegisterHostThread();
|
system.RegisterHostThread();
|
||||||
|
|
||||||
auto current_context = context.Acquire();
|
auto current_context = context.Acquire();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue