mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 09:55:45 +00:00
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
5130168171
commit
acdce3b4df
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