Scheduler: Add protections for Yield bombing
In case of redundant yields, the scheduler will now idle the core for it's timeslice, in order to avoid continuously yielding the same thing over and over.
This commit is contained in:
parent
82218c925a
commit
103f3a2fe5
5 changed files with 31 additions and 24 deletions
|
@ -373,19 +373,19 @@ void Thread::Sleep(s64 nanoseconds) {
|
|||
WakeAfterDelay(nanoseconds);
|
||||
}
|
||||
|
||||
void Thread::YieldSimple() {
|
||||
bool Thread::YieldSimple() {
|
||||
auto& scheduler = kernel.GlobalScheduler();
|
||||
scheduler.YieldThread(this);
|
||||
return scheduler.YieldThread(this);
|
||||
}
|
||||
|
||||
void Thread::YieldAndBalanceLoad() {
|
||||
bool Thread::YieldAndBalanceLoad() {
|
||||
auto& scheduler = kernel.GlobalScheduler();
|
||||
scheduler.YieldThreadAndBalanceLoad(this);
|
||||
return scheduler.YieldThreadAndBalanceLoad(this);
|
||||
}
|
||||
|
||||
void Thread::YieldAndWaitForLoadBalancing() {
|
||||
bool Thread::YieldAndWaitForLoadBalancing() {
|
||||
auto& scheduler = kernel.GlobalScheduler();
|
||||
scheduler.YieldThreadAndWaitForLoadBalancing(this);
|
||||
return scheduler.YieldThreadAndWaitForLoadBalancing(this);
|
||||
}
|
||||
|
||||
void Thread::SetSchedulingStatus(ThreadSchedStatus new_status) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue