Case Study On Different Scheduling Algorithms
Case Study On Different Scheduling Algorithms
3- Because the first process is not required to wait, the waiting time for process 1 will be
zero.
4- Calculate the waiting time for all other processes, i.e., waiting time[i] = burst time[i-1]
+ waiting time[i-1] for process i.
6- Calculate the average waiting time by multiplying total waiting time by the number of
processes.
7- Calculate the average turnaround time by multiplying total turn around time by the
number of processes.
Algorithm :
1- Continue traversing until all of the processes are finished.
a) At each time lap, locate the process with the least amount of time left.
b) Cut it by one minute.
c) Determine if the time left is zero.
d) Add to the process completion counter.
e) Completion time of current process = current_time +1;
f)Calculate the amount of time it will take to finish each process.
wt[i]= Time to completion - arrival time-burst time
g)Add one to the time lap.
Algorithm :
1- Make an array to keep track of how much time is left for processes to burst. This
array is a duplicate of the burst times array at first.
2- Make a new array to keep track of process waiting times. Set the value of this array
to 0.
3- Initialize time : t = 0
4- Continue traversing all processes as long as they aren't completed. If you haven't
already, complete the i'th procedure.
(i) t = t + quantum
Algorithm
1. To begin, provide the arrival time, burst time, and priority of the processes.
2. If two or more processes have the same earliest arrival time, the higher priority
process will be scheduled first.
3. Further procedures will now be planned depending on the time and priority of
their arrival. (We're assuming that the lower the priority number, the more important
it is.) Sort by process number if two processes have the same priority.
Comparisons
Round Robin vs FCFS
It means that when we see which algorithm is completing more processes per
unit time. For example, if we see one algorithm that gives a throughput of 1
process/ sec and another gives 3 processes/sec we will say the latter is a better
choice.
If there are only a limited number of processes that need to run on a system then
every algorithm will give the same throughput, but generally, there are lots of
processes working in the background. So it may happen that one process only
needs one microsecond to finish but will get that one microsecond after 3
seconds then the processor’s throughput will definitely decrease. FCFS takes on
one process and completes it before giving the processor to another process. On
the other hand, round-robin gives a chunk of the processor’s time to each
process. Hence better throughput.
Conclusions
Round-robin scheduling allows an equal amount of CPU time for each
job. Tasks are in a circular queue in their most basic form, and when a
job's assigned CPU time expires, the task is moved to the back of the
queue, and a new task is added to the front. In many real-time
applications, round-robin scheduling is insufficient since each job may
demand variable amounts of CPU resources depending on the
intricacy of the processing performed. Priority-based scheduling is a
variant of pure round-robin scheduling in which activities with the
same priority levels receive equal amounts of CPU time. It's also
possible to give each job a varied maximum CPU time.