Presentation is loading. Please wait.

Presentation is loading. Please wait.

Homework 2 Sarah Diesburg Operating Systems COP 4610.

Similar presentations


Presentation on theme: "Homework 2 Sarah Diesburg Operating Systems COP 4610."— Presentation transcript:

1 Homework 2 Sarah Diesburg Operating Systems COP 4610

2 Why does OS loader set kernel mode? OS needs to run with full privileges  Sets more restrictive user mode bit for user programs  Protects OS from errant user programs

3 Three Processes Process A Process B Process C Time

4 First In, First Out Process A Process B Process C FIFO Time BCA

5 First In, First Out Process A Process B Process C FIFO Average response time = [(300-50) + ( ) + 0]/3 = 200 Time BCA

6 First In, First Out Process A Process B Process C FIFO Average wait time = [(300-50) + ( ) + 0]/3 = 200 Time BCA

7 First In, First Out Process A Process B Process C FIFO Average turnaround time = [(500-50) + ( ) + (300-0)]/3 = 500 Time BABCA

8 Round Robin (Time slice = 100) Process A Process B Process C RR Time C

9 Process A Process B Process C RR Round Robin (Time slice = 100) Time C

10 Process A Process B Process C RR Round Robin (Time slice = 100) Time CA

11 Process A Process B Process C RR Round Robin (Time slice = 100) Time CA

12 Process A Process B Process C RR Round Robin (Time slice = 100) Time CAC

13 Process A Process B Process C RR Round Robin (Time slice = 100) Time CAC

14 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACB

15 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACB

16 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACBA

17 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACBA

18 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACBAC

19 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACBAC

20 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACBACB

21 Process A Process B Process C RR Round Robin (Time slice = 100) Time CACBACB

22 Process A Process B Process C RR Average response time = [(100-50) + (300 – 150) + 0]/3 = 66.7 Round Robin (Time slice = 100) Time CACBACB

23 Process A Process B Process C RR Average wait time = {[(100–50) + (400–200)] + [(300–150) + (600–400)] + [0 + (200–100) + (500–300)]}/3 = [ ]/3 = 300 Round Robin (Time slice = 100) Time CACBACB

24 Process A Process B Process C RR Average turnaround time = [(500 – 50) + (900 – 150) + (600 – 0)]/3 = 600 Round Robin (Time slice = 100) Time CACBACB

25 Shortest Job Next Process A Process B Process C SJN Time C

26 Shortest Job Next Process A Process B Process C SJN Time C

27 Shortest Job Next Process A Process B Process C SJN Time CA

28 Shortest Job Next Process A Process B Process C SJN Time CA

29 Shortest Job Next Process A Process B Process C SJN Time CA

30 Shortest Job Next Process A Process B Process C SJN Time CAB

31 Shortest Job Next Process A Process B Process C SJN Time CAB

32 Shortest Job Next Process A Process B Process C SJN Average response time = [(300-50) + ( ) + 0]/3 = 200 Time CAB

33 Shortest Job Next Process A Process B Process C SJN Average wait time = [(300-50) + ( ) + 0]/3 = 200 Time CAB

34 Shortest Job Next Process A Process B Process C SJN Average turnaround time = [(500-50) + ( ) + (300-0)]/3 = 500 Time CAB

35 Shortest Remaining Time First Process A Process B Process C SRTF Time C

36 Shortest Remaining Time First Process A Process B Process C SRTF Time C

37 Shortest Remaining Time First Process A Process B Process C SRTF Time CA

38 Shortest Remaining Time First Process A Process B Process C SRTF Time CA

39 Shortest Remaining Time First Process A Process B Process C SRTF Time CAC

40 Shortest Remaining Time First Process A Process B Process C SRTF Time CAC

41 Shortest Remaining Time First Process A Process B Process C SRTF Time CACB

42 Shortest Remaining Time First Process A Process B Process C SRTF Time CACB

43 Shortest Remaining Time First Process A Process B Process C SRTF Average response time = [0 + ( ) + 0]/3 = 117 Time CACB

44 Shortest Remaining Time First Process A Process B Process C SRTF Average wait time = [0 + (500 – 150) + (250 – 50)]/3 = 183 Time CACB

45 Shortest Remaining Time First Process A Process B Process C SRTF Average turnaround time = [(250 – 50) + (900 – 150) + (500 – 0)]/3 = 483 Time CACB


Download ppt "Homework 2 Sarah Diesburg Operating Systems COP 4610."

Similar presentations


Ads by Google