From af139f4661185ceb6d2c016e2ba3cdd1034a5aa7 Mon Sep 17 00:00:00 2001 From: skidau Date: Thu, 10 Feb 2011 12:56:21 +0000 Subject: [PATCH] Used usleep(1) instead of _mm_pause on Linux and Mac OSX. This reduces the CPU usage in the video thread's idle loop. Added YieldCPU to the DSP LLE loop. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7125 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thread.h | 2 +- Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/Src/Thread.h b/Source/Core/Common/Src/Thread.h index a11e1abf2c..0a1aae1de8 100644 --- a/Source/Core/Common/Src/Thread.h +++ b/Source/Core/Common/Src/Thread.h @@ -142,7 +142,7 @@ void SetCurrentThreadAffinity(u32 mask); #ifdef _WIN32 YieldProcessor(); #elif defined(_M_IX86) || defined(_M_X64) - _mm_pause(); + usleep(1); #endif } diff --git a/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp b/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp index 2f995e61cc..41a25dea53 100644 --- a/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp +++ b/Source/Core/Core/Src/HW/DSPLLE/DSPLLE.cpp @@ -96,7 +96,7 @@ void DSPLLE::dsp_thread(DSPLLE *lpParameter) } Common::AtomicStore(dsp_lle->m_cycle_count, 0); } - // yield? + Common::YieldCPU(); } }