Question
This code is currently setting the schedule for an xv6 practice operating system and I was wondering how to modify this code from it's current
This code is currently setting the schedule for an xv6 practice operating system and I was wondering how to modify this code from it's current state, Round Robin, to MLFQ?
scheduler(void) { struct proc *p;
for(;;){ // Enable interrupts on this processor. sti();
// Loop over process table looking for process to run. acquire(&ptable.lock); for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ if(p->state != RUNNABLE) continue;
// Switch to chosen process. It is the process's job // to release ptable.lock and then reacquire it // before jumping back to us. proc = p; switchuvm(p); p->state = RUNNING; swtch(&cpu->scheduler, proc->context); switchkvm();
// Process is done running for now. // It should have changed its p->state before coming back. proc = 0; } release(&ptable.lock);
} }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started