mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-30 22:28:22 +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:
parent
dfc33cd412
commit
60a559af7e
Notes:
sideshowbarker
2024-07-18 09:12:49 +09:00
Author: https://github.com/tomuta
Commit: 60a559af7e
Pull-request: https://github.com/SerenityOS/serenity/pull/8669
Reviewed-by: https://github.com/gunnarbeutner
2 changed files with 38 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue