Question
1. Write a java program that will simulate First Come First Serve, Shortest Job Next, Shortest Remaining Time and Round Robin scheduling algorithms. For each
1. Write a java program that will simulate First Come First Serve, Shortest Job Next, Shortest Remaining Time and Round Robin scheduling algorithms. For each algorithm the program should compute waiting time and turnaround time of every job as well as the average wait time and average turnaround time. The average values should be consolidated in a table for easy comparison. Also the time quantum for Round Robin should be 4 ms (context switching time can be 0). You may use the following data to test your program:
Job | Arrival Time | CPU Cycle in ms |
a | 0 | 16 |
b | 3 | 2 |
c | 5 | 11 |
d | 9 | 6 |
e | 10 | 1 |
f | 12 | 9 |
g | 14 | 4 |
h | 16 | 14 |
i | 17 | 1 |
j | 19 | 8 |
2. Modify the program from part 1 to generate a random job and change the context switching time to 0.4 ms. Compare outputs from both runs and discuss which would be a better policy. Describe any drastic changes encountered and explain why if there are some.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started