Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

********************************************************************************

ID: 3861116 • Letter: #

Question

*****************************************************************************************

Hi,

Please assist. Must show all your work. Must use chart provided in your work.

Make your work Clear and Accurate

--------------------------------------------------------------------------------------------------------------------------

9. Analyze the performance of three scheduling mechanisms: Exponential Averaging, and true ShortestBurstFirst.   Calculate the Average Completion Time AND count the number of context switches.   The workload consists of the following:

P1: 11(3,4,4); P2: 7(2,5); P3: 17(2,4,5,6).      I/O between bursts for 4 time quantums.   Exp Ave default =2, alpha=0.6

Processes are executed in FIFO order within each queue.

Executing (initial pred=2, alpha =0.6)

Time

0

Exec

Ready

1,2,3

P1

2

P2

2

P3

2

I/O:4

Ave completion time =

Context switches=

True SJF: (shortest CPU-burst first)

Time

Executing

ReadyQ

1,2,3

I/O:4

Completion time ave = P1(23) + P2(13) + P3(38) = 74 /3 == 24.6.   Context switches = 9.  

Executing (initial pred=2, alpha =0.6)

Time

0

Exec

Ready

1,2,3

P1

2

P2

2

P3

2

I/O:4

Explanation / Answer

Processes are executed in FIFO order within each queue.

Executing (initial pred=2, alpha =0.6)

Time

0

2

6

8

12

14

18

20

24

26

30

32

36

38

42

44

48

50

54

56

60

62

Exec

P1

I/0

P2

I/0

P3

I/0

P1

I/0

P2

I/0

P3

I/0

P1

I/0

P2

I/0

P3

I/0

P1

I/0

P2

P3

Ready

1,2,3

P1

2

P2

2

P3

2

I/O:4

The next burst time is predicted with the above formula

P2 = 0.6*2+0.4*2 = 1.2+0.8 =2

P3 = 0.6*2+0.4*2 = 1.2+0.8 = 2 so like this we use the before value in the formula to calculate the future burst value , but in this example every time it is 2 , so in between every time I/o burst will take 4, which is depicted in the above table

P1=11,P2=7,P3=17

this will be the gantt chart

0 P1 2 I/O 6 P2 8 I/O 12 P3 14 I/O 18 P1 20 I/O 24 P2 26 I/O 30 P3 32 I/O 36 P1 38 I/O 42 P2 44 P3 46 I/O 50 P1 52 P2 53 I/O 57 P3 59 I/O 63 P1 65 I/O 69 P3 71 I/O 75 P1 77 I/O 81 P3 88

COMPLETION TIME = 53 + 77 + 88 /3 = 72.66

CONTEXT SWITCHES = 15

Shortest job First gantt cahrt will be like this

0 P2 7 I/O 11 P1 22 I/O 26 P3 43

completion time = 7+22+43/3 = 24 , context switches=3

Executing (initial pred=2, alpha =0.6)

Time

0

2

6

8

12

14

18

20

24

26

30

32

36

38

42

44

48

50

54

56

60

62

Exec

P1

I/0

P2

I/0

P3

I/0

P1

I/0

P2

I/0

P3

I/0

P1

I/0

P2

I/0

P3

I/0

P1

I/0

P2

P3

Ready

1,2,3

P1

2

P2

2

P3

2

I/O:4