Lab08: Objectives: Example Code
Lab08: Objectives: Example Code
Objectives
To learn
1. Classes and objects
2. Implementation of FCFS, SJF and RR
o1=myclass(2)
o1.disp()
2. FCFS algorithm
ALGORITHM:
∑ W_time(pn) = T_time(pn-1)
∑ T_time(pn) = W_time(pn) + S_time(pn).
6. Total waiting time is calculated by adding the waiting time of all processes.
7. Calculate Average
∑ Average_W_time=total_waiting _time/#of processes;
#Hint: Await=wt[1]+wt[2]+wt[3]+wt[4]
p="Turnaround time :"+repr(TAT)
print (p)
ALGORITHM:
2. RR (Round Robin)
ALGORITHM:
Exercises
Exercise 1
Exercise 2