From bd0990f9cb67e04a43adee0014a69583220d49d6 Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Tue, 11 Jan 2011 14:47:37 +0000 Subject: [PATCH] Minor tweak to savestates to help improve threaded responsiveness. May or may not work as expected (thread scheduling doesn't always behave in a consistent manner). Shouldn't hurt in any case. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4200 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/SysState.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pcsx2/gui/SysState.cpp b/pcsx2/gui/SysState.cpp index cf32b30f68..80813c4a71 100644 --- a/pcsx2/gui/SysState.cpp +++ b/pcsx2/gui/SysState.cpp @@ -430,6 +430,12 @@ protected: if (!woot->IsOk()) throw Exception::CannotCreateStream(tempfile); + // Scheduler hint (yield) -- creating and saving the file is low priority compared to + // the emulator/vm thread. Sleeping the executor thread briefly before doing file + // transactions should help reduce overhead. --air + + Yield(4); + // Write the version and screenshot: ScopedPtr out( new pxOutputStream(tempfile, new wxZipOutputStream(woot)) ); wxZipOutputStream* gzfp = (wxZipOutputStream*)out->GetWxStreamBase();