Presentation is loading. Please wait.

Presentation is loading. Please wait.

Uniprocessor Scheduling III CPSC 410 Operating Systems Department of Physics, Computer Science and Engineering Christopher Newport University.

Similar presentations


Presentation on theme: "Uniprocessor Scheduling III CPSC 410 Operating Systems Department of Physics, Computer Science and Engineering Christopher Newport University."— Presentation transcript:

1 Uniprocessor Scheduling III CPSC 410 Operating Systems Department of Physics, Computer Science and Engineering Christopher Newport University

2 Question (1) zConsider the following set of processes: Process Name Arrival Time Processing Time 102 214 328 436 Perform the analysis of a comparison of scheduling policies: FCFS, RR(q=1), RR(q=4), SPN, SRT, HRRN, Feedback(q=1), and Feedback(q=2 i ).

3

4 P1 P2 P3 P4 01234567891011121314151617181920

5 Solution of Question 3 - FCFS (3) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process First Come First Served (FCFS) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

6 P1 P2 P3 P4 01234567891011121314151617181920

7 Solution of Question 3 – RR (q=1) (5) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process Round Robin (RR q=1) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

8 P1 P2 P3 P4 01234567891011121314151617181920

9 Solution of Question 3 – RR (q=4) (7) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process Round Robin (RR q=4) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

10 P1 P2 P3 P4 01234567891011121314151617181920

11 Solution of Question 3 - SPN (9) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process Shortest Process Next (SPN) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

12 P1 P2 P3 P4 01234567891011121314151617181920

13 Solution of Question 3 - SRT (11) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process Shortest Remaining Time (SRT) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

14 P1 P2 P3 P4 01234567891011121314151617181920

15 Solution of Question 3 - HRRN (13) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process Highest Response Ratio Next (HRRN) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

16 P1 P2 P3 P4 01234567891011121314151617181920

17 Solution of Question 3 – FB q=1 (15) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process Feedback (FB q=1) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

18 P1 P2 P3 P4 01234567891011121314151617181920

19 Solution of Question 3 – FB q=2 i (17) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 * Each square represents one time unit. The number refers to the running process Feedback (FB q=2 i ) Process P i 1 2 3 4 Average Arrival Time T a 0 1 2 3 Service Time T s 2 4 8 6 Finish Time T f Turnaround Time T q T q = T f - T a Normalized T q /T s Turnaround Time

20 Question 2 - Exercise/Home Work (1) Five batch jobs, A through E, arrive at a computer center at essentially the same time. They have an estimated running time of 15, 9, 3, 6, and 12 minutes, respectively. Their (externally defined) priorities are 4, 7, 3, 1, and 6, respectively, with 10 being the highest priority. For each of the following scheduling algorithms, determine the turnaround time for each process and the average turnaround for all job. Ignore process switching overhead. In the last three cases, assume that only one job at a time runs until it finishes and that all jobs are completely processor-bound. (a) priority scheduling (b) FCFS (run in order 15, 9, 3, 6, and 12) (c) shortest job first.


Download ppt "Uniprocessor Scheduling III CPSC 410 Operating Systems Department of Physics, Computer Science and Engineering Christopher Newport University."

Similar presentations


Ads by Google