> released: 02/10, 18:00 > due: 02/16, 23:59 > > Answer the following questions. > Submit your answers to Canvas assignments. There is an entry for this homework. > > > 1. Shortest Time to Completion First > > Below is the scheduling game we played in class (with the same assumptions). > Schedule the following processes using STCF scheduling algorithm (2 points) > > Process Arrival Running Time > P1 0 4 > P2 3 3 > P3 4 2 > P4 7 1 > > 1.a Schedule: > 0 1 2 3 4 5 6 7 8 9 [answer: 0 1 2 3 4 5 6 7 8 9 P1 P1 P1 P1 P3 P3 P2 P4 P2 P2 ] > > 1.b What is the average turnaround time? (1 point) [answer: Avg turnaround time = (4 + 7 + 2 + 1) / 4 = 3.5 ] > > > 1.c What is the average response time? (1 point) [answer: Avg response time = (0 + 3 + 0 + 0) / 4 = 0.75 ] > 2. Round Robin > > Below is the scheduling game we played in class (with the same assumptions). > Schedule the following processes using RR scheduling algorithm > with **time slice = 2**. (2 points) > > Process Arrival Running time > P1 0 3 > P2 0+\epsilon 2 > P3 0+2\epsilon 5 > > 2.a schedule: > > 0 1 2 3 4 5 6 7 8 9 [answer: 0 1 2 3 4 5 6 7 8 9 P1 P1 P2 P2 P3 P3 P1 P3 P3 P3 ] > > 2.b What is the average turnaround time? (1 point) [answer: avg turnaround time = (7 + 4 + 10) / 3 = 7 ] > 2.c What is the average response time? (1 point) > [answer: avg response time = (0 + 2 + 4) / 3 = 2 ] > > 3. Multi-level Feedback Queue > > Schedule the processes below [update 2/10: was "blow"; typo] using MLFQ. > HW3 MLFQ works as follows: > - There are three queues---q1, q2, and q3. > - The Queues q1,q2 and q3 have priorities high, medium, and low, respectively > - Among queues, we run Prio algorithm. > (namely, a process in a lower priority queue runs only when higher priority > queues are empty.) > - q1 and q2 run RR with time slice 1 and 2 respectively. > - q3 runs FIFO. > - When a process arrives, it is added at the head of q1. > (namely, the new arrival process will run first.) > - If a process runs for 4 units in one queue, its priority is reduced > by one level and the process is moved to the lower queue. > > > Process Arrival Running time > P1 0 6 > P2 2 3 > P3 5 4 > > Schedule: > 0 1 2 3 4 5 6 7 8 9 10 11 12 > [answer: 0 1 2 3 4 5 6 7 8 9 10 11 12 P1 P1 P2 P1 P2 P3 P1 P2 P3 P3 P3 P1 P1 ]