Round Robin Algorithm Exercise
Round Robin Algorithm Exercise
In a system there are 4 sensors, each capturing a signal, which are: A, with
a arrival time of 1 and an execution time of 4. B, with an arrival time of
2 and a runtime of 3. C, with an arrival time of 4 and a time of
Execution of 4; and D, with a arrival time of 6 and an execution time of 2.
Resolve using Round Robin with a Quantum of 2.
Solution:
Quantum = 2
(1)
(2)
Arrival // A B C D
Unit 0 1 2 3 4 5 6 7 8 9 10 11 12 13
Execute // A A B B C C D D B A A C C
How much 1 2 1 2 1 2 1 2 1 1 2 1 2
m
(3)
READY A B C D A C
Explanation:
At first, we considered the arrival time and the execution time of each.
resource, representing each sensor in the table (2), where in the first row we identify
the arrival time of each Sensor Signal, arranged by the values in the table and
following the time units of the second row.
Clarifications:
-The process B that continues at 9 is not added to the Ready columns because it has not
fulfilled with the entire interval of the Quantum, taking only one unit of it.
Likewise, process B continuing at 9 is prioritized for execution over A.
and of C since it requires less execution time.
As both A and C are waiting and both require the same interval of
time to complete its execution, we take whoever has taken the longest chronologically
waiting, being in this case A.
The column under execution in the second table is the amount of Quantum used,
which is limited to 2 for each arrival.
Formulas: