Professional Documents
Culture Documents
Ready queue is treated as a priority queue based on smallest CPU time requirement
When multiple batch jobs are sitting in a queue with the same priority, the
scheduler runs the shortest job first.
Store estimated value in PCB for the current burst, and compare with actual value.
Advantages:
Minimizes average waiting time.
Throughput is high.
Disadvantages:
It may penalize processes with high service time requests. If the ready
list is saturated, then processes with large service times tend to be left in
the ready list while small processes receive service. In extreme case,
where the system has
little idle time, processes with large service times will never be served. This total starvation of
large processes may be a serious liability of this algorithm.
Program::
#include<stdio.h>
void main()
{
int bt[20],p[20],wt[20],tat[20],i,j,n,total=0,pos,temp;
float avg_wt,avg_tat;
printf("Enter number of process:");
scanf("%d",&n);
temp=bt[i];
bt[i]=bt[pos];
bt[pos]=temp;
temp=p[i];
p[i]=p[pos];
p[pos]=temp;
}
total+=wt[i];
}