Round Robin scheduling.

 

Project : Write a computer program to simulate Round Robin scheduling.
Grade : 300 points
Submission:

• Bring in your code in class on to demonstrate as it runs. You will show me what you will have. You will always get partial credit even if the program does not run properly.
You have the code for a) arrival times and service times generation and b) Gantt chart drawing of RR from previous assignments.
Now in this project you will have to combine the two codes, make few changes according to the specification mentioned below and make the program run.

Round Robin
• Consider 100 processes. Process arrives at different times with different service times. They have different arrival times.
• The generated interarrival times will fall between the minimum value of 4 and maximum value of 9. In other words, all the 99 generated numbers will be between the range of 4 and 9.
The generated services times will fall between the minimum value of 2 and maximum value of 5.
• Upon arrival, a process can be appended at the end of the ready queue, top of the queue, or right after the current process, which is in service at the time of arrival. You choose the option you would like to implement.

• Process will have:
 ID
 Service time
 Arrival Time
These are input variables for each process.
• As time goes on, processes will be picked up by the dispatcher one at a time from the ready queue and will be allowed to execute for one quantum
o Quantum will be a variable in your program. Use quantum = 1 and then 3.
o Your program should be able to use any value for context switch, CS. Use CS = 0 to start with.
o Your program should also have a variable to represent the simulated clock time.
Simulation will start with clock time =0. Assume that the first process arrives and
starts at clock time 0.

• Main program will call various subprograms/ functions/modules as needed.
• If a process completes before the time quantum has been finished, do not waste the time just doing nothing. Let another process execute for one full quantum following RR algorithm. In other words, a process will get one quantum or less of service at a time.
• Your program
a) will calculate and output the following for all processes.

-Start time
-End time
-IntitialWait time
-TotalWait time
-Turnaround time

b) will calculate and output
-average interarrival time,
– average service times
-average Turnaround time
-average TotalWait time

Your output will look as follows for each process:

ID Start End IntitilWait TotalWait TurnAround

Note: you start with 10 processes and have your program and then move to 100 process.

This question has been answered.

Get Answer