Exp No 5 Round Robin Using LL 221070068
Exp No 5 Round Robin Using LL 221070068
EXPERIMENT No: 5
Round Robin using LL
AIM:
Design and implement a round-robin scheduling algorithm for a set of
processors with variable execution times utilizing a circular linked list to
represent the processors, and it simulates the execution of processes based
on a predefined quantum time.
THEORY:
The Round-Robin scheduling algorithm is one of the simplest and widely used
algorithms, especially in time-sharing systems. The program implemented
here simulates a basic round-robin scheduling scenario using a circular linked
list data structure.
The processors are represented using a circular linked list, where each node
of the list corresponds to a processor. The circular nature ensures that the
scheduling algorithm loops back to the beginning after reaching the end,
creating a continuous cycle.
Each node of the linked list, represented by the node structure, contains
information about a processor, including its ID, execution time, and a pointer
to the next processor in the list. Additionally, each processor has an
associated quantum time, representing the fixed time quantum for the round-
robin scheduling.
PROGRAM:
OUTPUT:
EXAMPLE:
The time provided by the architecture is 3s in each iteration for the processor
to run. The time when all its tasks are executed, the processor is no longer
taken into consideration.
In the above diagram, processor p0 requires 5s , p1 requires 3s, p2 requires
8s and p3 requires 6s, respectively to complete all their tasks.
So, with the help of a circular linked list execution time gets reduced and
Round-Robin scheduling allows each processor to execute once in every
iteration, till all of them are completed with their required execution(i.e their RT
becomes 0s).
ALGORITHM:
CONCLUSION:
In conclusion, the overall time complexity of this Round Robin scheduling
algorithm is O(n), where n is the number of processes. This is because each
operation (insert, quantum, delete) individually takes O(n) time in the worst
case, and these operations are not nested but are called sequentially. The space
complexity of the program is also O(n) for storing the processes in the circular
linked list. Here, n is the number of processes