1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

Kernel: Avoid unnecessary context switch when no other thread is ready

If no other thread is ready to be run we don't need to switch to the
idle thread and wait for the next timer interrupt. We can just give
the thread another timeslice and keep it running.
This commit is contained in:
Tom 2021-07-11 20:12:42 -06:00 committed by Gunnar Beutner
parent dfc33cd412
commit 60a559af7e
2 changed files with 38 additions and 0 deletions

View file

@ -44,6 +44,7 @@ public:
static void invoke_async();
static void notify_finalizer();
static Thread& pull_next_runnable_thread();
static Thread* peek_next_runnable_thread();
static bool dequeue_runnable_thread(Thread&, bool = false);
static void queue_runnable_thread(Thread&);
static void dump_scheduler_state();