From 7c0e08b0e7dd6caf35db7368015903f9048af3dc Mon Sep 17 00:00:00 2001 From: skidau Date: Tue, 14 Dec 2010 09:20:02 +0000 Subject: [PATCH] Forced the video thread to the third core when "Lock threads to cores" is enabled. This should fix the slowdown that this option produced on CPU's with HyperThreading. Thanks to NaturalViolence for the tip. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6579 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/Core.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 0370396ce6..ee59a34b7b 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -314,7 +314,12 @@ THREAD_RETURN EmuThread(void *pArg) CPluginManager &Plugins = CPluginManager::GetInstance(); if (_CoreParameter.bLockThreads) - Common::Thread::SetCurrentThreadAffinity(2); // Force to second core + { + if (cpu_info.num_cores > 3) + Common::Thread::SetCurrentThreadAffinity(3); // Force to third, non-HT core + else + Common::Thread::SetCurrentThreadAffinity(2); // Force to second core + } INFO_LOG(OSREPORT, "Starting core = %s mode", _CoreParameter.bWii ? "Wii" : "Gamecube"); INFO_LOG(OSREPORT, "CPU Thread separate = %s", _CoreParameter.bCPUThread ? "Yes" : "No");