Browse Source

[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 <lizzie@eden-emu.dev>
pull/3119/head
lizzie 1 month ago
parent
commit
69bc7874cb
  1. 8
      src/core/hle/service/services.cpp

8
src/core/hle/service/services.cpp

@ -84,6 +84,8 @@ Services::Services(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system
// BEGONE cold clones of lambdas, for I have merged you all into a SINGLE lambda instead of // 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 // 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<std::pair<std::string_view, void (*)(Core::System&)>>{ for (auto const& e : std::vector<std::pair<std::string_view, void (*)(Core::System&)>>{
{"audio", &Audio::LoopProcess}, {"audio", &Audio::LoopProcess},
{"FS", &FileSystem::LoopProcess}, {"FS", &FileSystem::LoopProcess},
@ -92,11 +94,7 @@ Services::Services(std::shared_ptr<SM::ServiceManager>& sm, Core::System& system
{"Loader", &LDR::LoopProcess}, {"Loader", &LDR::LoopProcess},
{"nvservices", &Nvidia::LoopProcess}, {"nvservices", &Nvidia::LoopProcess},
{"bsdsocket", &Sockets::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<std::pair<std::string_view, void (*)(Core::System&)>>{
//
{"sm", &SM::LoopProcess}, {"sm", &SM::LoopProcess},
{"account", &Account::LoopProcess}, {"account", &Account::LoopProcess},
{"am", &AM::LoopProcess}, {"am", &AM::LoopProcess},

Loading…
Cancel
Save