Implement a priority scheduling algorithm in xv6?
But i am unable to understand how to handle the scheduling in this. I am able to set the priorities using this code.
int
set_priority(int pid,int priority)
{
struct proc *p;
//acquire(&ptable.lock);
//cprintf("Set Priority - %d \n",priority);
for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
if((p->pid == pid) || (p->parent->pid == pid)){
p->priority = priority;
return 0;
}
}
//release(&ptable.lock);
return -1;
}