0% found this document useful (0 votes)
43 views

Embedded Systems Programming: Ver Onica Gaspes

The document discusses priority assignment for threads and messages to meet deadlines in embedded systems. It explains that static and dynamic priority approaches both have limitations and are not applicable to all programs. The document proposes initially considering a restricted model with periodic tasks, fixed periods, no internal communication, and known worst-case execution times, where deadlines are equal to periods. It notes more advanced real-time systems courses remove some of these restrictions.

Uploaded by

api-19643506
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Embedded Systems Programming: Ver Onica Gaspes

The document discusses priority assignment for threads and messages to meet deadlines in embedded systems. It explains that static and dynamic priority approaches both have limitations and are not applicable to all programs. The document proposes initially considering a restricted model with periodic tasks, fixed periods, no internal communication, and known worst-case execution times, where deadlines are equal to periods. It notes more advanced real-time systems courses remove some of these restrictions.

Uploaded by

api-19643506
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Assigning priorities Analysis

Embedded Systems Programming


Lecture 10

Verónica Gaspes
www2.hh.se/staff/vero

Center for Research on Embedded Systems


School of Information Science, Computer and Electrical Engineering
Assigning priorities Analysis

Priority assignment
Question
How do we set thread/message priority for the purpose of meeting
deadlines?

Static priorities Dynamic priorities


Assign a fixed priority to each Determine the priority at run-time
thread and keep it constant until from factors such as the time
termination. remaining until deadline.

:-(
In neither case a method exists that is both predictable and
generally applicable to all programs!

:-)
It is possible to get by if we concentrate on programs of a
restricted form.
Assigning priorities Analysis

Priority assignment
Question
How do we set thread/message priority for the purpose of meeting
deadlines?

Static priorities Dynamic priorities


Assign a fixed priority to each Determine the priority at run-time
thread and keep it constant until from factors such as the time
termination. remaining until deadline.

:-(
In neither case a method exists that is both predictable and
generally applicable to all programs!

:-)
It is possible to get by if we concentrate on programs of a
restricted form.
Assigning priorities Analysis

Priority assignment
Question
How do we set thread/message priority for the purpose of meeting
deadlines?

Static priorities Dynamic priorities


Assign a fixed priority to each Determine the priority at run-time
thread and keep it constant until from factors such as the time
termination. remaining until deadline.

:-(
In neither case a method exists that is both predictable and
generally applicable to all programs!

:-)
It is possible to get by if we concentrate on programs of a
restricted form.
Assigning priorities Analysis

Priority assignment
Question
How do we set thread/message priority for the purpose of meeting
deadlines?

Static priorities Dynamic priorities


Assign a fixed priority to each Determine the priority at run-time
thread and keep it constant until from factors such as the time
termination. remaining until deadline.

:-(
In neither case a method exists that is both predictable and
generally applicable to all programs!

:-)
It is possible to get by if we concentrate on programs of a
restricted form.
Assigning priorities Analysis

Priority assignment
Question
How do we set thread/message priority for the purpose of meeting
deadlines?

Static priorities Dynamic priorities


Assign a fixed priority to each Determine the priority at run-time
thread and keep it constant until from factors such as the time
termination. remaining until deadline.

:-(
In neither case a method exists that is both predictable and
generally applicable to all programs!

:-)
It is possible to get by if we concentrate on programs of a
restricted form.
Assigning priorities Analysis

Initial restricted model

Only periodic reactions


Fixed periods
Obj1 Ports
No internal
communication
Known, fixed WCETs
STARTUP
Deadlines = periods

More advanced courses on


real-time systems discuss how
Objn
Ports to remove some of these
restrictions.
Assigning priorities Analysis

Initial restricted model

Only periodic reactions


Fixed periods
Obj1 Ports
No internal
communication
Known, fixed WCETs
STARTUP
Deadlines = periods

More advanced courses on


real-time systems discuss how
Objn
Ports to remove some of these
restrictions.
Assigning priorities Analysis

Initial restricted model

Only periodic reactions


Fixed periods
Obj1 Ports
No internal
communication
Known, fixed WCETs
STARTUP
Deadlines = periods

More advanced courses on


real-time systems discuss how
Objn
Ports to remove some of these
restrictions.
Assigning priorities Analysis

Initial restricted model

Only periodic reactions


Fixed periods
Obj1 Ports
No internal
communication
Known, fixed WCETs
STARTUP
Deadlines = periods

More advanced courses on


real-time systems discuss how
Objn
Ports to remove some of these
restrictions.
Assigning priorities Analysis

Initial restricted model

Only periodic reactions


Fixed periods
Obj1 Ports
No internal
communication
Known, fixed WCETs
STARTUP
Deadlines = periods

More advanced courses on


real-time systems discuss how
Objn
Ports to remove some of these
restrictions.
Assigning priorities Analysis

Initial restricted model

Only periodic reactions


Fixed periods
Obj1 Ports
No internal
communication
Known, fixed WCETs
STARTUP
Deadlines = periods

More advanced courses on


real-time systems discuss how
Objn
Ports to remove some of these
restrictions.
Assigning priorities Analysis

Initial restricted model

Only periodic reactions


Fixed periods
Obj1 Ports
No internal
communication
Known, fixed WCETs
STARTUP
Deadlines = periods

More advanced courses on


real-time systems discuss how
Objn
Ports to remove some of these
restrictions.
Assigning priorities Analysis

Notation
Ti (=Di) Ti (=Di)

Ci Ci

Each reactive object obji executes a message (thread/task/job) mi


in a periodic fashion.

For each message mi


We know its period Ti (given, determines the AFTER offset)
We know its WCET Ci (meassured or analyzed)
We know its relative deadline Di (given, equal to Ti for now)
We want to determine its priority Pi !
Assigning priorities Analysis

Notation
Ti (=Di) Ti (=Di)

Ci Ci

Each reactive object obji executes a message (thread/task/job) mi


in a periodic fashion.

For each message mi


We know its period Ti (given, determines the AFTER offset)
We know its WCET Ci (meassured or analyzed)
We know its relative deadline Di (given, equal to Ti for now)
We want to determine its priority Pi !
Assigning priorities Analysis

Notation
Ti (=Di) Ti (=Di)

Ci Ci

Each reactive object obji executes a message (thread/task/job) mi


in a periodic fashion.

For each message mi


We know its period Ti (given, determines the AFTER offset)
We know its WCET Ci (meassured or analyzed)
We know its relative deadline Di (given, equal to Ti for now)
We want to determine its priority Pi !
Assigning priorities Analysis

Notation
Ti (=Di) Ti (=Di)

Ci Ci

Each reactive object obji executes a message (thread/task/job) mi


in a periodic fashion.

For each message mi


We know its period Ti (given, determines the AFTER offset)
We know its WCET Ci (meassured or analyzed)
We know its relative deadline Di (given, equal to Ti for now)
We want to determine its priority Pi !
Assigning priorities Analysis

Notation
Ti (=Di) Ti (=Di)

Ci Ci

Each reactive object obji executes a message (thread/task/job) mi


in a periodic fashion.

For each message mi


We know its period Ti (given, determines the AFTER offset)
We know its WCET Ci (meassured or analyzed)
We know its relative deadline Di (given, equal to Ti for now)
We want to determine its priority Pi !
Assigning priorities Analysis

In concrete code

The application
void ignite(){
BEFORE(D1 , &obj1 , m1 , arg1 );
BEFORE(D2 , &obj2 , m2 , arg2 );
.
.
.
BEFORE(Dn , &objn , mn , argn );
}

STARTUP(ignite());
Assigning priorities Analysis

In concrete code

The objects
Classi obji = initClassi ();

int mi (Classi *self, int arg){


// read ports
// compute
// update self state
// write ports
AFTERBEFORE(Ti , Di , self, mi ,arg);
}

Each Di = Ti
Assigning priorities Analysis

In concrete code

The objects
Classi obji = initClassi ();

int mi (Classi *self, int arg){


// read ports
// compute
// update self state
// write ports
AFTERBEFORE(Ti , Di , self, mi ,arg);
}

Each Di = Ti
Assigning priorities Analysis

Schematically (again)

Obj1 Ports

STARTUP

Objn
Ports
Assigning priorities Analysis

Static priorities – method

Rate monotonic (RM)


Under the given assumptions, there exists a static priority
assignment rule that is really simple

The shorter the period, the higher the priority

For RM, the actual priority values do not matter, only their relative
order.

Because of our inverse priority scale, we can simply implement RM


by letting Pi = Di (=Ti )
Assigning priorities Analysis

Static priorities – method

Rate monotonic (RM)


Under the given assumptions, there exists a static priority
assignment rule that is really simple

The shorter the period, the higher the priority

For RM, the actual priority values do not matter, only their relative
order.

Because of our inverse priority scale, we can simply implement RM


by letting Pi = Di (=Ti )
Assigning priorities Analysis

Static priorities – method

Rate monotonic (RM)


Under the given assumptions, there exists a static priority
assignment rule that is really simple

The shorter the period, the higher the priority

For RM, the actual priority values do not matter, only their relative
order.

Because of our inverse priority scale, we can simply implement RM


by letting Pi = Di (=Ti )
Assigning priorities Analysis

RM example

Given a set of periodic tasks with periods


T1 = 25ms
T2 = 60ms
T3 = 45ms

Valid priority assignments


P1 = 10 P1 = 1 P1 = 25
P2 = 19 P2 = 3 P2 = 60
P3 = 12 P3 = 2 P2 = 45
Assigning priorities Analysis

RM example

Given a set of periodic tasks with periods


T1 = 25ms
T2 = 60ms
T3 = 45ms

Valid priority assignments


P1 = 10 P1 = 1 P1 = 25
P2 = 19 P2 = 3 P2 = 60
P3 = 12 P3 = 2 P2 = 45
Assigning priorities Analysis

RM example

(High) T1

(Low) T2

(Mid) T3

For each task, the period is equal to its deadline. Arrows mark
start of period. Blue when they get to execute. Gray when they
have to wait for higher prio tasks to complete.
Assigning priorities Analysis

RM example

(High) T1

(Low) T2

(Mid) T3

For each task, the period is equal to its deadline. Arrows mark
start of period. Blue when they get to execute. Gray when they
have to wait for higher prio tasks to complete.
Assigning priorities Analysis

Dynamic priorities – method

Earliest Deadline First – EDF


Under the given assumptions, there exists a dynamic priority
assignment rule that is really simple:

The shorter the time remaining until deadline, the higher


the priority

Because EDF will want to distinguish between messsages on basis


of their absolute deadlines, priority values must use the same units
as the system clock.

Under EDF, each activation n of periodic task i will receive a new


priority: Pi(n) = baselinei(n) + Di
Assigning priorities Analysis

Dynamic priorities – method

Earliest Deadline First – EDF


Under the given assumptions, there exists a dynamic priority
assignment rule that is really simple:

The shorter the time remaining until deadline, the higher


the priority

Because EDF will want to distinguish between messsages on basis


of their absolute deadlines, priority values must use the same units
as the system clock.

Under EDF, each activation n of periodic task i will receive a new


priority: Pi(n) = baselinei(n) + Di
Assigning priorities Analysis

Dynamic priorities – method

Earliest Deadline First – EDF


Under the given assumptions, there exists a dynamic priority
assignment rule that is really simple:

The shorter the time remaining until deadline, the higher


the priority

Because EDF will want to distinguish between messsages on basis


of their absolute deadlines, priority values must use the same units
as the system clock.

Under EDF, each activation n of periodic task i will receive a new


priority: Pi(n) = baselinei(n) + Di
Assigning priorities Analysis

EDF example

T1

T2

T3

T1 arrives later, but its deadline is earlier than both T2’s and T3’s
absolute deadlines!
Assigning priorities Analysis

EDF example

T1

T2

T3

T1 arrives later, but its deadline is earlier than both T2’s and T3’s
absolute deadlines!
Assigning priorities Analysis

EDF example

T1

T2

T3

Deadline of T1 < Deadline of T2


Assigning priorities Analysis

EDF example

T1

T2

T3

(absolute) Deadline of T1 > (absolute) Deadline of T2


Assigning priorities Analysis

Optimality

Under some given assumptions, there might be several ways of


assigning priorities so that deadlines are met.

Clearly, a method that only fails if every other method also fails is
preferred — such a method is called optimal

RM is optimal among static assignment methods


EDF is optimal among dynamic methods
Assigning priorities Analysis

Optimality

Under some given assumptions, there might be several ways of


assigning priorities so that deadlines are met.

Clearly, a method that only fails if every other method also fails is
preferred — such a method is called optimal

RM is optimal among static assignment methods


EDF is optimal among dynamic methods
Assigning priorities Analysis

Optimality

Under some given assumptions, there might be several ways of


assigning priorities so that deadlines are met.

Clearly, a method that only fails if every other method also fails is
preferred — such a method is called optimal

RM is optimal among static assignment methods


EDF is optimal among dynamic methods
Assigning priorities Analysis

Schedulability

However, knowing that a priority assignment is the best one


possible is not the same thing as knowing that it is good enough,
i.e. knowing that deadlines actually will be met!

Assume all we know is that our priority assignment method is


optimal. This is like knowing where the shortest path from A to B
lies, but still not knowing if the path is short enough so that B can
be reached in time
Assigning priorities Analysis

Schedulability

However, knowing that a priority assignment is the best one


possible is not the same thing as knowing that it is good enough,
i.e. knowing that deadlines actually will be met!

Assume all we know is that our priority assignment method is


optimal. This is like knowing where the shortest path from A to B
lies, but still not knowing if the path is short enough so that B can
be reached in time
Assigning priorities Analysis

Schedulability

To answer whether our tasks will actually meet their deadlines at


run-time, we need to determine if our task set is at all schedulable
(recall that an optimal priority assignment method will produce a
successful schedule if such a schedule exists)

Clearly, the question of schedulability must take the WCETs of


tasks into account!
Assigning priorities Analysis

Schedulability

To answer whether our tasks will actually meet their deadlines at


run-time, we need to determine if our task set is at all schedulable
(recall that an optimal priority assignment method will produce a
successful schedule if such a schedule exists)

Clearly, the question of schedulability must take the WCETs of


tasks into account!
Assigning priorities Analysis

Utilization-based analysis
Ti

Ci

For a periodic task set, an important measure is how big a fraction


of each turn a task is actually using the CPU.

Ci
That is, the CPU utilization of a periodic task i is the ratio Ti ,
where Ci is the WCET and Ti is the period.

Note
Any task for which Ci =Ti will effectively need exclusive access to
the CPU!
Assigning priorities Analysis

Utilization-based analysis
Ti

Ci

For a periodic task set, an important measure is how big a fraction


of each turn a task is actually using the CPU.

Ci
That is, the CPU utilization of a periodic task i is the ratio Ti ,
where Ci is the WCET and Ti is the period.

Note
Any task for which Ci =Ti will effectively need exclusive access to
the CPU!
Assigning priorities Analysis

Utilization-based analysis
Ti

Ci

For a periodic task set, an important measure is how big a fraction


of each turn a task is actually using the CPU.

Ci
That is, the CPU utilization of a periodic task i is the ratio Ti ,
where Ci is the WCET and Ti is the period.

Note
Any task for which Ci =Ti will effectively need exclusive access to
the CPU!
Assigning priorities Analysis

Utilization-based analysis (RM)

Given a set of simple periodic tasks, scheduling with priorities


according to RM will succeed if
N
X Ci
U≡ ≤ N(21/N − 1)
Ti
i=1

where N is the number of threads.

That is, the sum of all CPU utilizations must be less than a certain
bound that depends on N.
Assigning priorities Analysis

Utilization-based analysis (RM)

Given a set of simple periodic tasks, scheduling with priorities


according to RM will succeed if
N
X Ci
U≡ ≤ N(21/N − 1)
Ti
i=1

where N is the number of threads.

That is, the sum of all CPU utilizations must be less than a certain
bound that depends on N.
Assigning priorities Analysis

Utilization bounds

N Utilization bound
1 100.0 %
2 82.8 %
3 78.0 %
4 75.7 %
5 74.3 %
10 71.8 %

Approaches 69.3% asymptotically


Assigning priorities Analysis

Example A

Task Period WCET Utilization


i Ti Ci Ui
1 50 12 24%
2 40 10 25%
3 30 10 33%

The combined utilization U is 82%, which is above the bound for 3


threads (78%).

The task set fails the utilization test.


Assigning priorities Analysis

Time-line for example A

+ +

Missed
deadline

0 10 20 30 40 50 60
Assigning priorities Analysis

Example B

Task Period WCET Utilization


i Ti Ci Ui
1 80 32 40%
2 40 5 12.5%
3 16 4 25%

The combined utilization U is 77.5%, which is below the bound for


3 threads (78%).

The task set will meet all its deadlines!


Assigning priorities Analysis

Time-line for example B

7 + 12 + 4 + + 6 7 +

5 5 5

4 4 4 4 4 4 4
0 16 32 48 64 80 96
Assigning priorities Analysis

Example C

Task Period WCET Utilization


i Ti Ci Ui
1 80 40 50%
2 40 10 25%
3 20 5 25%

The combined utilization U is 100%, which is well above the


bound for 3 threads (78%).

However, this task set still meets all its deadlines!

How can this be??


Assigning priorities Analysis

Time-line for example C

5 15 5 15

10 10

5 5 5 5
0 10 20 30 40 50 60 70 80
Assigning priorities Analysis

Characteristics

The utilization-based test


Is sufficient (pass the test and you are OK)
Is not necessary (fail, and you might still have a chance)

Why bother with such a test?


Because it is so simple!
Because only very specific sets of tasks fail the test and still
meet their deadlines!
Assigning priorities Analysis

Characteristics

The utilization-based test


Is sufficient (pass the test and you are OK)
Is not necessary (fail, and you might still have a chance)

Why bother with such a test?


Because it is so simple!
Because only very specific sets of tasks fail the test and still
meet their deadlines!
Assigning priorities Analysis

Utilization-based analysis (EDF)

Given a set of simple periodic tasks, scheduling with priorities


according to RM will succeed if
N
X Ci
U≡ ≤1
Ti
i=1

That is, the sum of all CPU utilizations must be less than 100%,
independent of the number of tasks.

Unlike the case for RM, the utilization-based test for EDF is both
sufficient and necessary (demand more than 100% of the CPU and
you are bound to fail!)
Assigning priorities Analysis

Utilization-based analysis (EDF)

Given a set of simple periodic tasks, scheduling with priorities


according to RM will succeed if
N
X Ci
U≡ ≤1
Ti
i=1

That is, the sum of all CPU utilizations must be less than 100%,
independent of the number of tasks.

Unlike the case for RM, the utilization-based test for EDF is both
sufficient and necessary (demand more than 100% of the CPU and
you are bound to fail!)
Assigning priorities Analysis

Utilization-based analysis (EDF)

Given a set of simple periodic tasks, scheduling with priorities


according to RM will succeed if
N
X Ci
U≡ ≤1
Ti
i=1

That is, the sum of all CPU utilizations must be less than 100%,
independent of the number of tasks.

Unlike the case for RM, the utilization-based test for EDF is both
sufficient and necessary (demand more than 100% of the CPU and
you are bound to fail!)
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Similarities
Both algorithms are optimal within their class
Both are easy to implement in terms of priority queues
Both have simple utilization-based schedulability tests
Both can be extended in similar ways

Advantages of EDF
Close relation to terminology of real-time specifications
Directly applicable to sporadic, interrupt-driven tasks
superior CPU utilization
Assigning priorities Analysis

EDF vs RM

Drawbacks of EDF
It exhibits random behaviour under transient overload (but so
does RM, in fact, in a different way)
RM predictably skips low priority tasks under constant
overload (but EDF rescales task periods instead)
Utilization-based test becomes more elaborate for EDF when
Di ≤ Ti (but is still feasible)
Operating systems generally don’t support it (priority scales
lack granularity, no automatic time-stamping)
Few languages allow for natural deadline constraints

However, for reactive objects, EDF fits nice as an alternative to RM


Assigning priorities Analysis

EDF vs RM

Drawbacks of EDF
It exhibits random behaviour under transient overload (but so
does RM, in fact, in a different way)
RM predictably skips low priority tasks under constant
overload (but EDF rescales task periods instead)
Utilization-based test becomes more elaborate for EDF when
Di ≤ Ti (but is still feasible)
Operating systems generally don’t support it (priority scales
lack granularity, no automatic time-stamping)
Few languages allow for natural deadline constraints

However, for reactive objects, EDF fits nice as an alternative to RM


Assigning priorities Analysis

EDF vs RM

Drawbacks of EDF
It exhibits random behaviour under transient overload (but so
does RM, in fact, in a different way)
RM predictably skips low priority tasks under constant
overload (but EDF rescales task periods instead)
Utilization-based test becomes more elaborate for EDF when
Di ≤ Ti (but is still feasible)
Operating systems generally don’t support it (priority scales
lack granularity, no automatic time-stamping)
Few languages allow for natural deadline constraints

However, for reactive objects, EDF fits nice as an alternative to RM


Assigning priorities Analysis

EDF vs RM

Drawbacks of EDF
It exhibits random behaviour under transient overload (but so
does RM, in fact, in a different way)
RM predictably skips low priority tasks under constant
overload (but EDF rescales task periods instead)
Utilization-based test becomes more elaborate for EDF when
Di ≤ Ti (but is still feasible)
Operating systems generally don’t support it (priority scales
lack granularity, no automatic time-stamping)
Few languages allow for natural deadline constraints

However, for reactive objects, EDF fits nice as an alternative to RM


Assigning priorities Analysis

EDF vs RM

Drawbacks of EDF
It exhibits random behaviour under transient overload (but so
does RM, in fact, in a different way)
RM predictably skips low priority tasks under constant
overload (but EDF rescales task periods instead)
Utilization-based test becomes more elaborate for EDF when
Di ≤ Ti (but is still feasible)
Operating systems generally don’t support it (priority scales
lack granularity, no automatic time-stamping)
Few languages allow for natural deadline constraints

However, for reactive objects, EDF fits nice as an alternative to RM


Assigning priorities Analysis

EDF vs RM

Drawbacks of EDF
It exhibits random behaviour under transient overload (but so
does RM, in fact, in a different way)
RM predictably skips low priority tasks under constant
overload (but EDF rescales task periods instead)
Utilization-based test becomes more elaborate for EDF when
Di ≤ Ti (but is still feasible)
Operating systems generally don’t support it (priority scales
lack granularity, no automatic time-stamping)
Few languages allow for natural deadline constraints

However, for reactive objects, EDF fits nice as an alternative to RM


Assigning priorities Analysis

EDF vs RM

Drawbacks of EDF
It exhibits random behaviour under transient overload (but so
does RM, in fact, in a different way)
RM predictably skips low priority tasks under constant
overload (but EDF rescales task periods instead)
Utilization-based test becomes more elaborate for EDF when
Di ≤ Ti (but is still feasible)
Operating systems generally don’t support it (priority scales
lack granularity, no automatic time-stamping)
Few languages allow for natural deadline constraints

However, for reactive objects, EDF fits nice as an alternative to RM


Assigning priorities Analysis

Implementation (RM)
In TinyTimber.c
struct msg_block{
...
Time baseline;
Time priority;
...
};

void async(Time offset, Time prio,


OBJECT *to, METHOD meth, int arg){
...
m->baseline=MAX(TIMERGET(),
current->baseline+offset);
m->priority = prio;
...
}
Assigning priorities Analysis

Implementation (EDF)
In TinyTimber.c
struct msg_block{
...
Time baseline;
Time deadline;
...
};

void async(Time BL, Time DL,


OBJECT *to, METHOD meth, int arg){
...
m->baseline=MAX(TIMERGET(),
current->baseline+BL);
m->deadline = m->baseline+DL;
...
}
Assigning priorities Analysis

More on real-time

Loosening the restrictions


What can be said if we allow tasks/threads/messages that are not
periodic or for which deadline is not equal to period or that can
block?

Other analysis
Response-time analysis, a more powerful technique than utilization
based, is needed.

We leave this for more specialized courses on real-time (such as


distributed real time systems)
Assigning priorities Analysis

More on real-time

Loosening the restrictions


What can be said if we allow tasks/threads/messages that are not
periodic or for which deadline is not equal to period or that can
block?

Other analysis
Response-time analysis, a more powerful technique than utilization
based, is needed.

We leave this for more specialized courses on real-time (such as


distributed real time systems)
Assigning priorities Analysis

More on real-time

Loosening the restrictions


What can be said if we allow tasks/threads/messages that are not
periodic or for which deadline is not equal to period or that can
block?

Other analysis
Response-time analysis, a more powerful technique than utilization
based, is needed.

We leave this for more specialized courses on real-time (such as


distributed real time systems)

You might also like