diff options
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index e6dcb9639..53281cc6c 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -35,24 +35,11 @@ void GlobalScheduler::RemoveThread(const Thread* thread) { | |||
| 35 | thread_list.end()); | 35 | thread_list.end()); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | /* | ||
| 39 | * UnloadThread selects a core and forces it to unload its current thread's context | ||
| 40 | */ | ||
| 41 | void GlobalScheduler::UnloadThread(s32 core) { | 38 | void GlobalScheduler::UnloadThread(s32 core) { |
| 42 | Scheduler& sched = system.Scheduler(core); | 39 | Scheduler& sched = system.Scheduler(core); |
| 43 | sched.UnloadThread(); | 40 | sched.UnloadThread(); |
| 44 | } | 41 | } |
| 45 | 42 | ||
| 46 | /* | ||
| 47 | * SelectThread takes care of selecting the new scheduled thread. | ||
| 48 | * It does it in 3 steps: | ||
| 49 | * - First a thread is selected from the top of the priority queue. If no thread | ||
| 50 | * is obtained then we move to step two, else we are done. | ||
| 51 | * - Second we try to get a suggested thread that's not assigned to any core or | ||
| 52 | * that is not the top thread in that core. | ||
| 53 | * - Third is no suggested thread is found, we do a second pass and pick a running | ||
| 54 | * thread in another core and swap it with its current thread. | ||
| 55 | */ | ||
| 56 | void GlobalScheduler::SelectThread(u32 core) { | 43 | void GlobalScheduler::SelectThread(u32 core) { |
| 57 | const auto update_thread = [](Thread* thread, Scheduler& sched) { | 44 | const auto update_thread = [](Thread* thread, Scheduler& sched) { |
| 58 | if (thread != sched.selected_thread) { | 45 | if (thread != sched.selected_thread) { |
| @@ -114,10 +101,6 @@ void GlobalScheduler::SelectThread(u32 core) { | |||
| 114 | update_thread(current_thread, sched); | 101 | update_thread(current_thread, sched); |
| 115 | } | 102 | } |
| 116 | 103 | ||
| 117 | /* | ||
| 118 | * YieldThread takes a thread and moves it to the back of the it's priority list | ||
| 119 | * This operation can be redundant and no scheduling is changed if marked as so. | ||
| 120 | */ | ||
| 121 | bool GlobalScheduler::YieldThread(Thread* yielding_thread) { | 104 | bool GlobalScheduler::YieldThread(Thread* yielding_thread) { |
| 122 | // Note: caller should use critical section, etc. | 105 | // Note: caller should use critical section, etc. |
| 123 | const u32 core_id = static_cast<u32>(yielding_thread->GetProcessorID()); | 106 | const u32 core_id = static_cast<u32>(yielding_thread->GetProcessorID()); |
| @@ -132,12 +115,6 @@ bool GlobalScheduler::YieldThread(Thread* yielding_thread) { | |||
| 132 | return AskForReselectionOrMarkRedundant(yielding_thread, winner); | 115 | return AskForReselectionOrMarkRedundant(yielding_thread, winner); |
| 133 | } | 116 | } |
| 134 | 117 | ||
| 135 | /* | ||
| 136 | * YieldThreadAndBalanceLoad takes a thread and moves it to the back of the it's priority list. | ||
| 137 | * Afterwards, tries to pick a suggested thread from the suggested queue that has worse time or | ||
| 138 | * a better priority than the next thread in the core. | ||
| 139 | * This operation can be redundant and no scheduling is changed if marked as so. | ||
| 140 | */ | ||
| 141 | bool GlobalScheduler::YieldThreadAndBalanceLoad(Thread* yielding_thread) { | 118 | bool GlobalScheduler::YieldThreadAndBalanceLoad(Thread* yielding_thread) { |
| 142 | // Note: caller should check if !thread.IsSchedulerOperationRedundant and use critical section, | 119 | // Note: caller should check if !thread.IsSchedulerOperationRedundant and use critical section, |
| 143 | // etc. | 120 | // etc. |
| @@ -189,12 +166,6 @@ bool GlobalScheduler::YieldThreadAndBalanceLoad(Thread* yielding_thread) { | |||
| 189 | return AskForReselectionOrMarkRedundant(yielding_thread, winner); | 166 | return AskForReselectionOrMarkRedundant(yielding_thread, winner); |
| 190 | } | 167 | } |
| 191 | 168 | ||
| 192 | /* | ||
| 193 | * YieldThreadAndWaitForLoadBalancing takes a thread and moves it out of the scheduling queue | ||
| 194 | * and into the suggested queue. If no thread can be squeduled afterwards in that core, | ||
| 195 | * a suggested thread is obtained instead. | ||
| 196 | * This operation can be redundant and no scheduling is changed if marked as so. | ||
| 197 | */ | ||
| 198 | bool GlobalScheduler::YieldThreadAndWaitForLoadBalancing(Thread* yielding_thread) { | 169 | bool GlobalScheduler::YieldThreadAndWaitForLoadBalancing(Thread* yielding_thread) { |
| 199 | // Note: caller should check if !thread.IsSchedulerOperationRedundant and use critical section, | 170 | // Note: caller should check if !thread.IsSchedulerOperationRedundant and use critical section, |
| 200 | // etc. | 171 | // etc. |