summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2017-01-05 19:12:39 +0100
committerSubv <subv2112@gmail.com>2017-01-05 19:12:39 +0100
commit933df2606a34d4e609e890f45d0bef11e01da0ee (patch)
tree902f603a836ddc4679d86fd66da9db7ce9547ad4 /src/core/hle/kernel/thread.cpp
parentMerge pull request #2393 from Subv/synch (diff)
downloadyuzu-933df2606a34d4e609e890f45d0bef11e01da0ee.tar
yuzu-933df2606a34d4e609e890f45d0bef11e01da0ee.tar.gz
yuzu-933df2606a34d4e609e890f45d0bef11e01da0ee.tar.bz2
yuzu-933df2606a34d4e609e890f45d0bef11e01da0ee.tar.lz
yuzu-933df2606a34d4e609e890f45d0bef11e01da0ee.tar.xz
yuzu-933df2606a34d4e609e890f45d0bef11e01da0ee.tar.zst
yuzu-933df2606a34d4e609e890f45d0bef11e01da0ee.zip
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 9109bd10b..5ff75803f 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -156,28 +156,6 @@ void ArbitrateAllThreads(u32 address) {
}
}
-/// Boost low priority threads (temporarily) that have been starved
-static void PriorityBoostStarvedThreads() {
- u64 current_ticks = CoreTiming::GetTicks();
-
- for (auto& thread : thread_list) {
- // TODO(bunnei): Threads that have been waiting to be scheduled for `boost_ticks` (or
- // longer) will have their priority temporarily adjusted to 1 higher than the highest
- // priority thread to prevent thread starvation. This general behavior has been verified
- // on hardware. However, this is almost certainly not perfect, and the real CTR OS scheduler
- // should probably be reversed to verify this.
-
- const u64 boost_timeout = 2000000; // Boost threads that have been ready for > this long
-
- u64 delta = current_ticks - thread->last_running_ticks;
-
- if (thread->status == THREADSTATUS_READY && delta > boost_timeout) {
- const s32 priority = std::max(ready_queue.get_first()->current_priority - 1, 0);
- thread->BoostPriority(priority);
- }
- }
-}
-
/**
* Switches the CPU's active thread context to that of the specified thread
* @param new_thread The thread to switch to
@@ -211,9 +189,6 @@ static void SwitchContext(Thread* new_thread) {
ready_queue.remove(new_thread->current_priority, new_thread);
new_thread->status = THREADSTATUS_RUNNING;
- // Restores thread to its nominal priority if it has been temporarily changed
- new_thread->current_priority = new_thread->nominal_priority;
-
Core::CPU().LoadContext(new_thread->context);
Core::CPU().SetCP15Register(CP15_THREAD_URO, new_thread->GetTLSAddress());
} else {
@@ -557,8 +532,6 @@ SharedPtr<Thread> SetupMainThread(u32 entry_point, s32 priority) {
}
void Reschedule() {
- PriorityBoostStarvedThreads();
-
Thread* cur = GetCurrentThread();
Thread* next = PopNextReadyThread();