From 69bc7874cbbd8b1425212cae27c467dfea4449aa Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 29 Nov 2025 07:33:20 +0000 Subject: [PATCH] [hle/service] Move all services to the guest thread This may inadvertedly create higher contention (especially with services like vi) However my main expectation is that most services are sleepy (most of the time atleast) and moving them onto the guest thread will benefit to reduce external contention, that is, contention within the emulated guest threads, not within the system threads The expected overhead is to be less than to have a physical thread for each service... id hope Please test performance regressions ESPECIALLY on weak devices Signed-off-by: lizzie --- src/core/hle/service/services.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/hle/service/services.cpp b/src/core/hle/service/services.cpp index 636f54ad49..0e1090118f 100644 --- a/src/core/hle/service/services.cpp +++ b/src/core/hle/service/services.cpp @@ -84,6 +84,8 @@ Services::Services(std::shared_ptr& sm, Core::System& system // BEGONE cold clones of lambdas, for I have merged you all into a SINGLE lambda instead of // spamming lambdas like it's some kind of lambda calculus class + kernel.RunOnGuestCoreProcess("vi", [&, token] { VI::LoopProcess(system, token); }).detach(); + // Avoid cold clones of lambdas -- succintly for (auto const& e : std::vector>{ {"audio", &Audio::LoopProcess}, {"FS", &FileSystem::LoopProcess}, @@ -92,11 +94,7 @@ Services::Services(std::shared_ptr& sm, Core::System& system {"Loader", &LDR::LoopProcess}, {"nvservices", &Nvidia::LoopProcess}, {"bsdsocket", &Sockets::LoopProcess}, - }) - kernel.RunOnHostCoreProcess(std::string(e.first), [&system, f = e.second] { f(system); }).detach(); - kernel.RunOnHostCoreProcess("vi", [&, token] { VI::LoopProcess(system, token); }).detach(); - // Avoid cold clones of lambdas -- succintly - for (auto const& e : std::vector>{ + // {"sm", &SM::LoopProcess}, {"account", &Account::LoopProcess}, {"am", &AM::LoopProcess},