{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

OS Assignment2

OS Assignment2 - Ex 5.12 a FCFS 0 10 11 13 14 19 b SJF 1 1...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Ex) 5.12 a) FCFS: 0 10 11 13 14 19 b) SJF: 1. 1 2 4 9 19 c) Non-Preemptive priority: 0 1 6 16 18 19 d) Round Robin: P1 P2 P3 P4 P5 P1 P3 P5 P1 P5 P1 P5 P1 P5 P1 P1 P1 P1 P1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
b) TAT (Turnaround time) = ET (Process end time) - AT (when process arrives) i) FCFS: P1 (TAT) = 10; P2 (TAT) = 11, P3 (TAT) = 13, P4 (TAT) = 14, P5 (TAT) = 19. ii) SJF: P1 (TAT) = 19; P2 (TAT) = 1, P3 (TAT) = 4, P4 (TAT) = 2, P5 (TAT) = 9. iii) Non-Preemptive Priority: P1 (TAT) = 16; P2 (TAT) = 1, P3 (TAT) = 18, P4 (TAT) = 19, P5 (TAT) = 6. iv) RR: P1 (TAT) = 19; P2 (TAT) = 2, P3 (TAT) = 7, P4 (TAT) = 4, P5 (TAT) = 14. c) WT (Waiting time) = TAT - BT (Burst time) i) FCFS: P1(10-10)= 0; P2 (11-1)= 10, P3(13-2) = 11, P4(14-1)= 13, P5(19-5)= 14. ii) SJF: P1(19-10)= 9; P2 (1-1)= 0, P3(4-2) = 2, P4(2-1)= 1, P5(9-5)= 4. iii) Non-Preemptive Priority: P1(1-10)= 6; P2 (1-1)= 0, P3(18-2) = 16, P4(19-1)= 18, P5(6-5)= 1. iv) RR: P1(19-10)= 9; P2 (2-1)= 1, P3(7-2) = 11, P4(4-1)= 3, P5(14-5)= 9. d) Average waiting time AWT: FCFS (AWT) = 9.6, SJF (AWT) = 3.2, Non-Preemptive priority (AWT) = 8.2, RR (AWT) = 5.4 SJF has the least AWT. Ex 5.15) Case 1) Time Quantum = 1ms Time for one CPU bound task including switch overhead = 1 + 0.1 = 1.1ms Time for one CPU bound task without switch overhead = 1ms Time for 10 I/O bound tasks including overhead = 1.1*10 = 11ms
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}