mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
Kernel: Set the colonel task to low priority.
This gives it a smaller time slice, improving responsiveness.
This commit is contained in:
parent
8501fdc6f5
commit
6416123cfb
1 changed files with 2 additions and 5 deletions
|
@ -294,11 +294,6 @@ void Scheduler::switch_now()
|
|||
bool Scheduler::context_switch(Thread& thread)
|
||||
{
|
||||
thread.set_ticks_left(time_slice_for(thread.process().priority()));
|
||||
|
||||
// FIXME(Thread): This is such a hack.
|
||||
if (&thread == &s_colonel_process->main_thread())
|
||||
thread.set_ticks_left(1);
|
||||
|
||||
thread.did_schedule();
|
||||
|
||||
if (current == &thread)
|
||||
|
@ -386,6 +381,8 @@ void Scheduler::initialize()
|
|||
s_redirection.selector = gdt_alloc_entry();
|
||||
initialize_redirection();
|
||||
s_colonel_process = Process::create_kernel_process("colonel", nullptr);
|
||||
// Make sure the colonel uses a smallish time slice.
|
||||
s_colonel_process->set_priority(Process::LowPriority);
|
||||
load_task_register(s_redirection.selector);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue