Practical stuff for Exam Flashcards
2 Scheduling Pre-emptive Algorithm:
Round Robin(RR) Smallest remaining time first (SRTF)
2 Scheduling Non-Pre-emptive Algorithm:
and what does non-preemptive mean?
FCFS
SJN(SPN)
Once the process gets scheduled, it will run till the completion
Waiting time formula?
WT=Ts - Ta
start time - arrival time
Turnaround time formula?
TT=WT + B (burst time)
B=end time -start time
TT= finish time - AT
Response time formula?
RT=start time(Ts) - process start time(T0)
Response ratio formula?
TT/B
Turnaround time /Burst time
How to plot ‘X’ in FCFS table?
1) Sort Process table by arrival time
2) Plot arrival time using ->
3) Plot ‘X’ from start of burst time till finish
4) if same priority level then choose with earliest AT
How to plot ‘X’ in SPN table
1) Sort Process table by burst time
2) plot ax with arriavl time O
3) do process which has shortest bT just look at sorted table
4) If longer process but higher priority do higher priority one
How to plot ‘X’ in RR table
Round Robin- each process is an given an equal time slice
1) Sort Process table by arrival time
2) Plot arrival time using ->
3) you can only put ‘X’ as many times as quantum/time slice
4) if ‘X’ plotted and no other process has arrived then plot again
5) follow order in process table
How to plot ‘X’ in SRTF table
No queue
1) Sort Process table by arrival time
Cache: calculate Fault Ratio(FR)
FR = Fault/(Fault + Hit)
change answer to %
Cache: calculate Hit Ratio(HR)
HR= Hit/(Fault + Hit)
Or
1 - FR
How to compare algorithms?
Choose the one closest to Optimum
Best Cases:
Highest HR
Lowest FR
How to solve Banker’s Algorithm
need = max/claim - allocation
Then do avaliable +allocation