cs211 lab2


http://www.maths.nuigalway.ie/~gettrick/teach/cs211/




A set of processes (lets say n of them, denoted by P1, P2,....,Pn) is sent to a CPU. The processes arrive in the order given, at times t=0, t=1,...t=n. The duration (in seconds) of these processes is given (d1, d2,....dn). Write a PYTHON program which reads in these durations as input data from the user, and which calculates (a) the average waiting time and (b) the average turnaround time for the processes. These two numbers should be calculated for the scheduling policies of
  1. Shortest Remaining Time First
  2. Round Robin (with CPU slices of 4 seconds)
Test your program on the process durations [5,12,3,2,7,6,4,10,9] and [2,9,8,13,4,5,11,6,9,10] and report the results in both cases for the times (a) and (b)

© University of Galway