PROCESS SCHEDULING

Experiment Number 4 : Preemptive Priority scheduling



Algorithm

• Step 1: First input the processes with their burst time and priority.

• Step 2: Sort the processes, burst time and priority according to the priority.

• Step 3: Now simply apply FCFS algorithm.

• Step 4: Input the processes along with their burst time (bt).

• Step 5: Find waiting time (wt) for all processes.

• Step 6: As first process that comes need not to wait so waiting time for process 1 will be 0 i.e. wt[0] = 0.

• Step 7: Find waiting time for all other processes wt[i] = bt[i-1] + wt[i-1] .

• Step 8: Find turnaround time = waiting time + burst time for all processes.

• Step 9: Find average waiting time = total waiting time / no of processes.

• Step 10: Similarly, find average turnaround time = total turn-around time / no of processes.