diff options
author | Tom <tomut@yahoo.com> | 2021-07-11 20:12:42 -0600 |
---|---|---|
committer | Gunnar Beutner <gunnar@beutner.name> | 2021-07-12 10:19:31 +0200 |
commit | 60a559af7ebc70f3604ce8b5649551560d87923b (patch) | |
tree | b1785ed20681506c81817c991a3bc151b331d7b7 /Kernel/Scheduler.h | |
parent | dfc33cd4129759fae2d96cabfed830a3360208f5 (diff) | |
download | serenity-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.h | 1 |
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(); |