Professional Documents
Culture Documents
1
9/15/2010
Notation of scheduling(2)
• Preemptive schedule:
• A schedule in which the running task can be arbitrarily
Idle J1 J2 J3 idle suspended at any time, to assign the CPU to another task
• Feasible schedule:
3 • A schedule where if all tasks can be completed according to a
(t) set of specified constraints
2
• Schedulable task set:
1 A time slice • A set of tasks for which there exists at least one scheduling
algorithm that can produce feasible schedule
t1 t2 t3 t4
2
9/15/2010
J1
• Timing constraints
t
J2 t
• Precedence constraints
J3 t • Resource constraints
(t)
• Timing constraints: Li
• Constraints on execution time, is the time that must be meet in order to Lateness
Ci
achieve the desired behavior.
• Typical constraint: deadline
• Relative deadline: deadline is specified with respect to the arrival time time
• Absolute deadline: deadline is specified with respect to time zero. fi
Di relative deadline
• Classification of real-time tasks Ci Execution
• Hard : if completion after its deadline can cause catastrophic time
consequence on the system
Ready
• Soft : if missing its deadline decrease the performance of the system but Running
does not jeopardize its correct behavior time
ai Si fi di
arrival time start time finishing absolute
time deadline
Xi Laxity
3
9/15/2010
Absolute deadline Arrival time • Two tasks can have a precedence constraint:
of 1st job of 2nd job • A task has to be executed after another task is completed
Di Di
Relative deadline Relative deadline • Notation:
• Precedence relations are described by a directed acycric graph
Ti period Ti G.
Ci Ci • : task Ja is a predecessor of task Jb
ready running ready running • : task Ja is an immediate predecessor of Jb
Φi
Phase
1st job 2nd job
4
9/15/2010
An example of
deriving precedence relations
• Resource
acq1 acq2 • Any software structure that can be used by the process to
advance its execution
• Ex:
edge1 edge2 • data structure, a set of variables, main memory area, a file, a
piece of program, a set of registers of a peripheral device
rec
5
9/15/2010
• Shared resource do not allow simultaneous accesses but Higher priority Lower priority
mutual exclusion (called mutually exclusive resource) J1 J2
• Critical section:
• A piece of code under mutual exclusion constraints
• Example:
Let R be a mutually exclusive resource shared by task Ja and Jb. Wait(s)
Wait(s)
If A is the operation performed on R by Ja and B by Jb Shared resource
Critical section
A and B must never be executed at the same time R Critical section
Signal(s)
Signal(s)
scheduling
• Scheduling with preemption
activation Termination
preempts blocked READY RUN
Higher priority
J1 preemption