The objective of this assignment is to evaluate various process scheduling strategies. This is achieved by generating random arrival times and CPU bursts for a set of processes following some probability distribution, and determining the performances of the chosen scheduling algorithms through simulation. The specifications for the problem are as follows.
- a) Read the number of processes N, and generate the arrival times and CPU bursts of the processes using some probability distribution. The first process is assumed to arrive at time 0; for all subsequent processes the inter-arrival time is generated as a random variable (between 0 and 10) following exponential distribution with some given mean. Also the CPU bursts of the processes are generated as uniform random variables (between 1 and 20). Save the generated table in a file.
Hint: If R is a uniform random number in the range (0, 1), a random variable from an exponential distribution with mean can be generated as:
(-1.0 / ) * ln R
- Simulate the following CPU scheduling algorithms on the process arrival trace as generated in (a) above, and compute the average turnaround times (ATN) for the processes:
- Non-preemptive First Come First Serve (FCFS)
- Non-preemptive Shortest Job First
- Pre-emptive Shortest Job First
- Round Robin with time quantum = 2 time units
- Highest response-ratio next (HRN)
- Run the simulation for N = 10, 50 and 100, ten times for each value of N using a shell script (bash/python), and generate the plot comparing the average values of ATN obtained for various scheduling techniques for different values of N.
- For FCFS (non-preemptive) determine the theoretically expected lower bound on the turn-around time and check whether that is satisfied by your simulation.
Submission Guideline:
Create the program as a single file as a3_<groupno>.c or .cpp. Create the plot file as a3_plot_<groupno>.pdf . Upload the two files.
Evaluation Guidelines:
While entering marks, the partwise break up should also be entered according to the marking guidelines given below. There is a separate component for individual assessment, based on how the student answers questions.
Sl | Items | Marks |
(a) | Random number generation (uniform, exponential) | 8 |
(b) | Maintaining job queues for scheduling | 8 |
(c) | Simulation of five scheduling strategies | 15 |
(d) | Generation of results and plots | 15 |
(e) | Shell script for running the jobs | 4 |
(f) | Theoretical analysis of FCFS | 5 |
Total | 55 |
Reviews
There are no reviews yet.