Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core/State: Rewrite threading behavior when multiple Save requests are happening. #10547

Merged

Conversation

AdmiralCurtiss
Copy link
Contributor

While trying to determine the cause of #10546 I noticed that there's some unfortunate locking happening in the state saving construct, which could lead to us temporary locking up if a second savestate request comes in or if emulation is paused while another is still compressing/writing to disk. This is my attempt to improve this.

In my experience it's noticeably more responsive now saving multiple states in a row or trying to load right after saving, at least when I artificially increase the savestate disk writing function time with Sleep(), which should be roughly equivalent to writing to a slow HDD. Saving a state and then pausing the game also no longer locks up the emulator until the state is done saving.

Source/Core/Core/State.cpp Outdated Show resolved Hide resolved
Source/Core/Core/State.cpp Outdated Show resolved Hide resolved
@dreamsyntax
Copy link
Member

Just confirming this branch does not resolve
#10546

The improvements should be kept regardless though

@AdmiralCurtiss AdmiralCurtiss force-pushed the save-state-threading branch 2 times, most recently from 8738f31 to 15f2ad9 Compare April 25, 2022 01:19
… all currently queued tasks to finish when shutting down the thread.
…e happening. Should improve responsiveness when eg. mashing a save state button.
@AdmiralCurtiss
Copy link
Contributor Author

This has been sitting here for a while and we're a few weeks away from a beta, so I'm just gonna merge this, alright?

@AdmiralCurtiss AdmiralCurtiss merged commit 2f0358a into dolphin-emu:master Oct 1, 2022
@AdmiralCurtiss AdmiralCurtiss deleted the save-state-threading branch October 1, 2022 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants