Lab (Scheduling)

technische universität
dortmund
fakultät für informatik
informatik 12
Lab 3: Scheduling
- Session 10 Peter Marwedel
Heiko Falk
TU Dortmund
Informatik 12
Germany
TU Dortmund
Rate monotonic scheduling

1. Exercise:
Assume a system of two periodic tasks. Task 1 has a period of 5 units and an
execution time of 3. Task 2 has a period of 8 and an execution time of 3. Let the
deadline be equal to its period.
a) Using rate monotonic scheduling, can any of the two processes miss its
deadline? Construct a formal argumentation answering this question, based
on the formula about the utilization of a processor when using rate
monotonic scheduling.
b) Which schedule is generated by rate monotonic scheduling for the above
two tasks? Draw a diagram where the x-axis reflects the time and the y-axis
lists all tasks. Put vertical lines in the diagram at those points of time where
tasks become available. Draw rectangles for those times where tasks are
really executed. Mark all those points of time where deadlines are missed, if
this ever happens. When scheduling, assume that the execution of a task
that has just missed its deadline is not caught up.
c) Verify your drawn schedule by using the software leviRTS.
technische universität
dortmund
fakultät für
informatik
 p. marwedel,
informatik 12, 2008
- 2-
TU Dortmund
EDF

2. Exercise:
Consider the following set of tasks where
An denotes the arrival time,
dn denotes the deadline and
cn denotes the execution time:
a)
b)
c)
An
dn
cn
T1
7
16
4
T2
4
15
5
T3
11
20
3
T4
0
26
10
Create a schedule of the above tasks using least laxity. Draw a diagram like
in exercise 1 showing when which task becomes active. Is there a task
missing its deadline?
Create a schedule of the above tasks using earliest deadline first. Draw a
diagram like in exercise 1 showing when which task becomes active. Is
there a task missing its deadline?
Verify your EDF schedule by making leviRTS produce the desired schedule.
technische universität
dortmund
fakultät für
informatik
 p. marwedel,
informatik 12, 2008
- 3-
TU Dortmund
Latest Deadline First

3. Exercise:
Assume a system of five interdependent tasks T1 to T5. The dependencies
between the tasks are described by the task graph below (Note: an edge Ti  Tj
means that task Tj can only be executed if Ti has finished execution). cn denotes
the execution time of a task and dn denotes the deadline interval of a task.
•
•
•
•
•
T2
T1 with c1 = 2 and d1 = 15,
T2 with c2 = 5 and d2 = 20,
T3 with c3 = 4 and d3 = 12,
T4 with c4 = 3 and d3 = 15,
T5 with c5 = 3 and d5 = 20
T3
T5
T1
T4
Schedule this task set using latest deadline first.
technische universität
dortmund
fakultät für
informatik
 p. marwedel,
informatik 12, 2008
- 4-
TU Dortmund
Resource Access Protocols

4. Exercise:
A task set consisting of tasks T1,
T2, T3 and T4 should be executed
on a processor with the following
priorities: P1 = 4 (lowest), P2 = 3,
P3 = 2, P4 = 1 (highest). The table
shows the values for the arrival
times, execution times and the
resource accesses for each task.
a)
b)
c)
Task
Arrival
Time
Execution
Printer
Time
t P t V
COM1
t P
t V
T1
0
20
1
14
4
5
T2
2
10
-
-
1
6
T3
4
5
-
-
-
-
T4
4
5
1
3
-
-
Generate an empty task scenario in the software leviRTS and select the
algorithm Resource Access Protocol (priority based, preemptive). Create the
tasks T1 to T4 with the above properties.
Start the visualization of this scenario. Which problems occur during
scheduling? What can be done to solve them?
Draw (manually) a schedule of the above tasks under the assumption that
priority inheritance is used. Verify your drawn schedule using leviRTS.
technische universität
dortmund
fakultät für
informatik
 p. marwedel,
informatik 12, 2008
- 5-