Question: For implementing this, make the required changes in scheduler function in proc.c file. / / Replace the scheduler function with the one below for priority
For implementing this, make the required changes in scheduler function in proc.c file.
Replace the scheduler function with the one below for priority round robin scheduling Loop over process table looking for process to run.acquire&ptable.lock;forp ptable.proc; p &ptable.procNPROC; p ifpstate 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 highP p; choose one with highest priority forp ptable.proc; p &ptable.procNPROC; p ifpstate RUNNABLE continue; ifhighPpriority plprioritylarger value, lower
priority
highP p;
p highP;
cproc p;
switchuvmp;
pstate RUNNING;
swtch&cscheduler pcontext;
switchkvm;
Process is done running for now.
It should have changed its pstate before coming back.
cproc ;
release&ptable.lock;
At this step, you have implemented the system calls and changed the scheduling policy in xv Now, let us try it out.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
