USE PYTHON The Problem The book claims a "reasonable compromise" for a time slice quantum is 10-50ms. Write a programto simulate Round Robin scheduling with a provided time slice. Choose 1 method of...

1 answer below »

USE PYTHON


The Problem


The book claims a "reasonable compromise" for a time slice quantum is 10-50ms. Write a programto simulate Round Robin scheduling with a provided time slice. Choose 1 method of mutual exclusion .




Description


Your program needs to read and "execute" 100 processes. Each process will contain several (non)critical sections. The output of the program should be a listing (table) of the time slice and the average completion time of the 100 processes.




Operation


Your program, like a computer, needs to prep the processes at first. The program will read/open all the processes and once they're all ready to go, you begin executing process #00. This is time 0.


As a process finishes, track its completion time. Once all processes are done, calculate the average completion time and print out the time slice and the average completion time.


You will need to run 100 simulations ranging the time slices from 5ms to 500ms in 5ms increments (i.e. 5ms, 10ms, 15ms,…,490ms, 495ms, 500ms).


Be sure to save all 100 data points to a file and once you have theme, create a graph to get a visual.




Process Files


The process files will be the same format as in homework #2,except, the section times will be between 5ms and 5000ms only, still, randomly generated and still at most 10000 "sections". Minumum of 7 sections, can be up to 1000 if 10000 takes too long. The processes should end in a non critical section


Example:


# Process #00
500
# first critical section
1500
200
15
5000
# End of Process #00




Execution


Because you have 100 simulations to perform, you may (and should) choose an automated method to do so. For example, perhaps your simulation is all put into a function and you simply loop on that function call:


for( ts=5; ts

perform_simulation( ts );


or, perhaps you'd rather have the time slice provided as a command line parameter and use a script to iterate over the values:


forTS in$(seq5 500); doif[[ $(( $TS% 5 )) -eq 0 ]]; then./homework3 $TS>> simulation_results.txt
fidone


So executing your program should be as simple as:


$ ./homework3
....
$


For this assignment, you don't readup to100 processes, you readALL100 processes. So make sure you have created all 100 process files.

Answered 8 days AfterApr 16, 2022

Answer To: USE PYTHON The Problem The book claims a "reasonable compromise" for a time slice quantum is...

Sathishkumar answered on Apr 16 2022
94 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here