mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 18:22:47 +01:00
SingleCore: Improve Cycle timing Behavior and replace mutex in global scheduler for spinlock.
This commit is contained in:
parent
a7ecd9e19c
commit
7e2ce2f7f4
3 changed files with 4 additions and 2 deletions
|
@ -253,6 +253,7 @@ void CpuManager::SingleCoreRunIdleThread() {
|
||||||
while (true) {
|
while (true) {
|
||||||
auto& physical_core = kernel.CurrentPhysicalCore();
|
auto& physical_core = kernel.CurrentPhysicalCore();
|
||||||
PreemptSingleCore(false);
|
PreemptSingleCore(false);
|
||||||
|
system.CoreTiming().AddTicks(1000U);
|
||||||
idle_count++;
|
idle_count++;
|
||||||
auto& scheduler = physical_core.Scheduler();
|
auto& scheduler = physical_core.Scheduler();
|
||||||
scheduler.TryDoContextSwitch();
|
scheduler.TryDoContextSwitch();
|
||||||
|
|
|
@ -188,7 +188,7 @@ private:
|
||||||
|
|
||||||
/// Scheduler lock mechanisms.
|
/// Scheduler lock mechanisms.
|
||||||
bool is_locked{};
|
bool is_locked{};
|
||||||
std::mutex inner_lock{}; // TODO(Blinkhawk): Replace for a SpinLock
|
Common::SpinLock inner_lock{};
|
||||||
std::atomic<s64> scope_lock{};
|
std::atomic<s64> scope_lock{};
|
||||||
Core::EmuThreadHandle current_owner{Core::EmuThreadHandle::InvalidHandle()};
|
Core::EmuThreadHandle current_owner{Core::EmuThreadHandle::InvalidHandle()};
|
||||||
|
|
||||||
|
|
|
@ -185,7 +185,8 @@ ResultCode ServerSession::CompleteSyncRequest() {
|
||||||
ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread,
|
ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread,
|
||||||
Core::Memory::Memory& memory) {
|
Core::Memory::Memory& memory) {
|
||||||
ResultCode result = QueueSyncRequest(std::move(thread), memory);
|
ResultCode result = QueueSyncRequest(std::move(thread), memory);
|
||||||
Core::System::GetInstance().CoreTiming().ScheduleEvent(0, request_event, {});
|
const u64 delay = kernel.IsMulticore() ? 0U : 20000U;
|
||||||
|
Core::System::GetInstance().CoreTiming().ScheduleEvent(delay, request_event, {});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue