Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

(CSCI 331) Homework Three

Note: The homework problems are selected from Chapter Three of your textbook. The students shall first read the book content and do all participant activities in corresponding section before they do the homework questions that are selected from that section. The homework needs to be typed in this word file and submitted via link on blackboard. You may rename this file as YourInitialsCSCI331HW03.docx.

Problem One (30 points) Scheduling with FIFO, SJF, and SRT

a) For the 5 processes described below, draw a timing diagram showing when each process executes under FIFO, SJF, and SRT.

Process

p1

p2

p3

p4

p5

Arrival time

0

2

4

6

8

Total CPU time

3

6

4

5

2

b) Determine the ATT for each scheduling algorithm for the 5 processes.

Problem Two (30 points)

The following sequence of CPU bursts has been observed: 7, 5, 6, 15, 15, 15.

a) Using 7 as the initial estimate S0, to generate the sequence of predictions, Si, for the corresponding observed values, Ti, where 1 ≤ i ≤ 5 and α = 0.8.

b) Repeat the same predictions for α = 0.5.

Problem Three (20 points) Determining quantum size

n processes are time-sharing the CPU, each requiring T ms of CPU time to complete. The context switching overhead is S ms.

a) What should be the quantum size Q such that the gap between the end of one quantum and the start of the next quantum of any process does not exceed M ms?

b) For n = 5, S = 10, and M = 450, M = 90, M = 50, determine

· The corresponding values of Q

· The percentage of CPU time wasted on context switching

Problem Four (20 points) Schedule with MLF

A MLF algorithm uses 5 priority levels. At level 5, a process executes for Q = 1 ms. At each of the lower levels the quantum is doubled (2Q, 4Q, 8Q, 16Q).
The following processes are to be scheduled:

Process

Arrival

Total CPU time

p1

0

1

p2

1

3

p3

1

14

After termination, process p1 blocks for 4 ms and then reenters the queue again at level 5. Similarly, process p2 blocks for 5 ms and then reenters the queue again at level 5

a) Draw a timing diagram for the first 33 ms. On each of the 3 lines (one per process) show when the process is running and at which priority level.

b) Determine the ATT for each process.