COSC6384 Real-Time Systems Assignment 1 (Spring 2007) Question1. Does a random scheduler obey the Queue discipline? Does a random scheduler obey the Stack discipline? Justify your answer with an example for each of them. Question2. Suppose a task consists of n subtasks, Ji each of which has computation time Ci, i=1,..., n. This task requests service at time T and has absolute deadline D. Summarize a formula to compute the latest deadline for completing each subtask such that the deadline of the entire task can be satisfied. Question3. (a) Show that the periodic tasks (10, 2), (15, 5) and (25, 9) are scheduled by the ratemonotonic algorithm. (b) Show that the periodic tasks (10, 2), (12, 5), and (15, 4) are not schedulable by the rate-monotonic algorithm. (c) Construct the initial segments in the time interval (0, 75) of a rate-monotonic schedule and a earliest-deadline-first schedule of the periodic tasks (10, 2), (15, 5), and (25, 12). Question4. (a) Use the time-demand analysis method to show that the rate-monotonic algorithm will produce a feasible schedule of the tasks (6, 1), (8, 2), and (15, 6). (b) Change the period of one of the tasks in part (a) to yield a set of tasks with the maximal total utilization which is feasible when scheduled using the ratemonotonic algorithm. (Consider only integer values for the period.) (c) Change the execution time of one of the tasks in part (a) to yield a set of tasks with the maximal total utilization which is feasible when scheduled using the ratemonotonic algorithm. (Consider only integer values for the execution time.) 1 Question5. Which of the following fixed-priority task(s) is not schedulable? Explain your answer. T1 = (3, 1), T2 = (5, 1), T3 = (7, 2.5) and T4 = (16, 1). Question6. Explain the main idea (why it works?) behind the Schedulability test 3 in the textbook. (For answer, read the reference paper [Lehoczky, Sha, and Ding, 1989] in the Bibliography section of your textbook) Question7. Construct a task set that can be scheduled by the RM, EDF and LLF algorithms. Question8. Given a task set which is rate monotonic schedulable, will the rate monotonic and earliest deadline first schedule be the same or different? Adjust your answer with examples. Question9. Give an LLF schedule for the following task set. TASK PERIOD COMPUTATION TIME A B C D 25 36 5 13 2 5 2 6 Question10. Compare the RM, EDF and LLF algorithms. (Advantages and disadvantages.) 2 Question11. Prove the optimality of the LL algorithm for a set of independent, preemptable tasks on a uniprocessor. Question12. We have assumed in lectures that context-switching due to preemption incurs no overhead. Now suppose context-switching (from one task to another) requires 'x' time units. Consider a system with 3 tasks with computation times C1, C2, C3 and periods P1, P2, P3 (which are equal to their deadlines and Pi < Pi+1). Derive the maximum value of 'x' for which this task set is RM-schedulable. Show calculations steps. Question13. A system of periodic tasks is simply periodic if for every pair of tasks Ti and Tk in the system and Pi < Pk, Pk is an integer multiple of Pi . Prove the theorem: A system of simply periodic, independent, preemptable tasks whose relative deadlines are equal to or larger than their periods is schedulable on one processor according to the RM algorithm if and only if its total utilization is equal to or less than 1. Question14. Determine whether there is a feasible schedule for the following set of periodic processes. If yes, show the schedule and the steps used to derive it. T1: c11 = 1, c12 = 3, c13 = 2, d1 = 17, p1 = 18 T2: c21 = 1, c22 = 2, d2 = 6, p2 = 6 T3: c3 = 1, d3 = p3 = 18 T1 must rendezvous with T2 after the first, second, and third scheduling blocks. T2 must rendezvous with T1 after the first scheduling block. 3 4