Compare commits

..

2 Commits

Author SHA1 Message Date
Drew Galbraith faa71d08c5 Reduce wait in async executor. 2025-02-01 14:29:38 -08:00
Drew Galbraith feb7c8e839 Increase scheduler frequency. 2025-02-01 14:29:08 -08:00
3 changed files with 4 additions and 4 deletions

View File

@ -116,7 +116,7 @@ impl Executor {
loop {
self.run_ready_tasks();
// TODO: We need some sort of semaphore wait here.
syscall::thread_sleep(50).unwrap();
syscall::thread_sleep(10).unwrap();
}
}

View File

@ -4,7 +4,7 @@
#include "interrupt/apic.h"
#include "interrupt/timer.h"
const uint32_t kScheduleFrequency = 20;
const uint32_t kScheduleFrequency = 100;
ApicTimer* gApicTimer = nullptr;
void ApicTimer::Init() {

View File

@ -186,12 +186,12 @@ uint64_t cnt = 0;
extern "C" void isr_apic_timer();
extern "C" void interrupt_apic_timer(InterruptFrame*) {
cnt++;
if (cnt % 20 == 0) {
if (cnt % 100 == 0) {
if (cnt == 20) {
KernelHeap::DumpDebugData();
phys_mem::DumpPhysicalMemoryUsage();
}
dbgln("timer: {}s", cnt * 50 / 1000);
dbgln("timer: {}s", cnt * 10 / 1000);
}
gApic->SignalEOI();
gScheduler->Preempt();