Homework 1

advertisement
COSC6384 Real-Time Systems
Assignment 1 (Fall 2006)
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 system T contains four period tasks, (8,1), (15,3), (20,4), and (22,6). Its total utilization
is 0.87. Construct the initial segment in the time interval (0,50) of a rate-monotonic
schedule of the system. All tasks arrive at time 0.
Question4
A system T contains three tasks, (8, 3) arriving at time 0, (9, 3) arriving at time 2 and (15,
3) arriving at time 1, is the system schedulable by the rate-monotonic algorithm? By the
EDF algorithm? What about T = {(8, 2), (10, 2) and (12, 3)} with the same arriving times?
Explain your answer.
Question5.
Which of the following fixed-priority task(s) is not schedulable? Explain your answer.
T1 = (5, 1), T2 = (3, 1), T3 = (7, 2.5) and T4 = (16, 1).
Question6.
Give two different explanations of why the periodic tasks (2, 1), (4, 1), and (8, 2) are
schedulable by the rate-monotonic algorithm.
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.
1
Give an LLF schedule for the following task set in the time interval (0, 50).
TASK
PERIOD COMPUTATION TIME
A
B
C
D
18
5
14
4
2
2
2
1
Question10.
Explain instances where the static and dynamic scheduler would be equivalent and when
they would differ. Which is more suitable for an operating system? Justify your answer in
detail.
Question11.
Prove the following theorem:
A system T of independent, preemptable periodic tasks that are in phase and have relative
deadlines equal to or less than their respective periods can be feasibly scheduled on one
processor according to the deadline-monotonic algorithm whenever it can be feasibly
scheduled according to any fixed-priority algorithm. (hint: this theorem is true because
we can always transform a feasible fixed-priority schedule that is not a DM schedule into
one that is.)
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 n tasks with computation times C1,C2,...,Cn and periods P1,
P2,...,Pn (which are equal to their deadlines and Pi < Pi+1). Derive the maximum value of
'x' for which this task set is EDF-schedulable. Show calculations steps.
Question13.
(a) The term priority-driven algorithms refers to a large class of scheduling algorithms
that never leave any resource idle intentionally. Stated in another way, a resource idles
only when no job requiring the resource is ready for execution. For scheduling tasks on a
single processor, are EDF (Earliest-Deadline-First), FIFO (First-In-First-Out), LRT
(Latest release time) all priority-driven algorithms? Explain your answer with simple
examples.
2
(b) Do you think under what situation(s) we have benefits by using LRT algorithm to
schedule hard real-time tasks?
Note: LRT or reverse EDF algorithm, treats release times as deadlines and deadlines as
release times and schedules the jobs backwards, starting from the latest deadline of all
jobs, in “priority-driven” manner, to the current time. In particular, the “priorities” are
based on the release times of jobs: the later the release time, the higher the “priority”. In
fact, the algorithm postpones the execution of tasks.
Question14.
A periodic process must be executed once in every period of the process. Suppose our
system has five processes with periods 30, 50, 80, 200 and 280 milliseconds each. These
five processes require 5, 10, 15, 40 and 100 msec of CPU time, respectively. It is
obviously that the system is overloaded. To make the system EDF-schedulable, suppose
we can either reduce the execution time of the task with period 280 or prolong the period
of the task with execution time 40. What is the minimum amount of reduction on the
execution time and of increase on the period respectively?
Question15.
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: c1 = 1, d1 = p1 = 12
T2: c21 = 1, c22 = 2, d2 = 5, p2 = 6
T3: c31 = 2, c32 = 3, d3 = 12, p3 = 12
T2 must rendezvous with T3 after the first scheduling block.
T3 must rendezvous with T2 after the first and second scheduling block.
3
Download