summaryrefslogtreecommitdiff
path: root/Kernel/Scheduler.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-07-11 20:12:42 -0600
committerGunnar Beutner <gunnar@beutner.name>2021-07-12 10:19:31 +0200
commit60a559af7ebc70f3604ce8b5649551560d87923b (patch)
treeb1785ed20681506c81817c991a3bc151b331d7b7 /Kernel/Scheduler.h
parentdfc33cd4129759fae2d96cabfed830a3360208f5 (diff)
downloadserenity-60a559af7ebc70f3604ce8b5649551560d87923b.zip
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.
Diffstat (limited to 'Kernel/Scheduler.h')
-rw-r--r--Kernel/Scheduler.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Kernel/Scheduler.h b/Kernel/Scheduler.h
index 26d9adeecb..ec48055e4b 100644
--- a/Kernel/Scheduler.h
+++ b/Kernel/Scheduler.h
@@ -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();