Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based...

139
Exception-Based Management of Timing Constraints Violations for Soft Real-Time Applications 1 T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioli}@sssup.it A. Evangelista [email protected] 30, June 2009 1 This work has been supported in part by the EU Commission within the context of the IRMOS FP7/2008/ICT/214777 European Project. T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.fag Exception-Based Management of Timing Constraints Violations f

Transcript of Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based...

Page 1: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exception-Based Management

of Timing Constraints Violationsfor Soft Real-Time Applications 1

T. Cucinotta, D. Faggioli

ReTiS Lab, Scuola Superiore Sant’Anna, CEIICvia G. Moruzzi 1,56124 Pisa (Italy)

{t.cucinotta, d.faggioli}@sssup.itA. Evangelista

[email protected]

30, June 2009

1This work has been supported in part by the EU Commission within thecontext of the IRMOS FP7/2008/ICT/214777 European Project.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 2: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 3: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 4: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 5: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 6: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 7: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 8: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 9: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Motivation for This Work

General Purpose Operating Systems are continuously beingenriched with real-time capabilities.

However, especially on general purpose computing platforms:

hardware is optimized for average performance,

execution times may heavily vary between jobs.

knowledge of detailed timing of applications is limited,

Some timing constraints violations should be expected, thussomething is needed:

to specify timing constraints inside the application,

to help developers in design and timing overrun handling.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 10: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 11: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 12: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 13: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 14: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 15: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 16: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 17: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 18: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Contribution of This Work

Two kind of of timing constraints:

deadline constraints, whenever a software component needs tocomplete within a certain (wall-clock) time,

WCET constraints, whenever a software component needs tonot exceed an predetermined execution time.

Exception-based management approach:

mechanism similar to exception management in C++, Java orAda,

available for the C language (widely used in embeddedsystems):

implemented by macros, i.e., no compiler modification needed,usable directly from the program, i.e., no external componentneeded,

support for arbitrary nesting.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 19: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Related Work

Need for predictable timing behavior of system components isparamount for real-time.

Existing –programming language level– solutions:

RTSJ: specialized exceptions to deal with timing specificationand enforcement,

ADA 2005: Asynchronous Transfer of Control, usable in caseof deadline and/or WCET violations,

RTC: introduces new syntactic “real-time constructs” into C,but requires non-standard/non-existent compiler.

Nothing for C programs and standard C compiler exists.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 20: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Related Work

Need for predictable timing behavior of system components isparamount for real-time.

Existing –programming language level– solutions:

RTSJ: specialized exceptions to deal with timing specificationand enforcement,

ADA 2005: Asynchronous Transfer of Control, usable in caseof deadline and/or WCET violations,

RTC: introduces new syntactic “real-time constructs” into C,but requires non-standard/non-existent compiler.

Nothing for C programs and standard C compiler exists.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 21: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Related Work

Need for predictable timing behavior of system components isparamount for real-time.

Existing –programming language level– solutions:

RTSJ: specialized exceptions to deal with timing specificationand enforcement,

ADA 2005: Asynchronous Transfer of Control, usable in caseof deadline and/or WCET violations,

RTC: introduces new syntactic “real-time constructs” into C,but requires non-standard/non-existent compiler.

Nothing for C programs and standard C compiler exists.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 22: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Related Work

Need for predictable timing behavior of system components isparamount for real-time.

Existing –programming language level– solutions:

RTSJ: specialized exceptions to deal with timing specificationand enforcement,

ADA 2005: Asynchronous Transfer of Control, usable in caseof deadline and/or WCET violations,

RTC: introduces new syntactic “real-time constructs” into C,but requires non-standard/non-existent compiler.

Nothing for C programs and standard C compiler exists.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 23: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Related Work

Need for predictable timing behavior of system components isparamount for real-time.

Existing –programming language level– solutions:

RTSJ: specialized exceptions to deal with timing specificationand enforcement,

ADA 2005: Asynchronous Transfer of Control, usable in caseof deadline and/or WCET violations,

RTC: introduces new syntactic “real-time constructs” into C,but requires non-standard/non-existent compiler.

Nothing for C programs and standard C compiler exists.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 24: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Related Work

Need for predictable timing behavior of system components isparamount for real-time.

Existing –programming language level– solutions:

RTSJ: specialized exceptions to deal with timing specificationand enforcement,

ADA 2005: Asynchronous Transfer of Control, usable in caseof deadline and/or WCET violations,

RTC: introduces new syntactic “real-time constructs” into C,but requires non-standard/non-existent compiler.

Nothing for C programs and standard C compiler exists.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 25: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

A Simple Example

Component based multimedia application.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 26: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

A Simple Example

Component based multimedia application.

(Sub)Components may came from libraries and/or third partysoftware packages.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 27: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

A Simple Example

Component based multimedia application.

(Sub)Components may came from libraries and/or third partysoftware packages.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 28: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

A Simple Example

Component based multimedia application.

(Sub)Components may came from libraries and/or third partysoftware packages.

Highly desirable design-time features:

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 29: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

A Simple Example

Component based multimedia application.

(Sub)Components may came from libraries and/or third partysoftware packages.

Highly desirable design-time features:

deadline indication and enforcement for each (sub)component.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 30: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

A Simple Example

Component based multimedia application.

(Sub)Components may came from libraries and/or third partysoftware packages.

Highly desirable design-time features:

deadline indication and enforcement for each (sub)component.WCET enforcement for each (sub)component:

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 31: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

A Simple Example

Component based multimedia application.

(Sub)Components may came from libraries and/or third partysoftware packages.

Highly desirable design-time features:

deadline indication and enforcement for each (sub)component.WCET enforcement for each (sub)component:

WCETPrsr+WCETFrmDec+WCETPostProc+WCETVis = WCETDecoder

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 32: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 33: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 34: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 35: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 36: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 37: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 38: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 39: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Requirements

A mechanism of such kind should:

support relative and absolute deadline constraint;

support WCET constraint;

support generic (timing) or specific recovery logic triggeringon violation of those two;

support both processes and threads;

support nesting of timing constraints;

support benchmarking timing behavior of components;

support being “switched off” for some code segments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 40: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 41: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 42: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 43: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 44: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 45: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 46: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 47: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 48: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 49: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 50: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exceptions for the C language

Open Macro Library (author’s former project,http://oml.sourceforge.net):

try: code segment subject to exception management;

when: code segment executed in reaction to an –the firstmatching– exception;

handle...end: code segments for one or more when clauses;

finally: code segment executed after the try, either anyexception fired or not;

Implemented by means of:

macros only, i.e., works with standard compilers (gcc);

POSIX long jumps (sigsetjmp(), siglongjmp()).

Moreover:

it is process and thread safe;

it allows nested exception throwing/catching (up to impl.defined level).

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 51: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Exception Example

d e f i n e e x c e p t i o n ( ENotReady ) ex tends ( EExcept ion ) ;vo id f oo ( ){

i f ( cond )throw ( ENotReady ) ;

}vo id bar ( ){

t r y { /∗ P o t e n t i a l l y f a u l t y code segment ∗/f ( ) ;

} f i n a l l y { /∗ Clean−up code ∗/}hand l e

when ( ENotReady ) { /∗ Handle the ENotReady ex c ep t i on ∗/}when ( EExcept ion ) { /∗ Handle any o the r e x c ep t i on ∗/}

end ;}

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 52: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exceptions

Additions to OML:

try within: code segment with relative deadline constraint;

try within abs: code segment with absolute deadline constraint;

try wcet: code segment with maximum allowed execution time(WCET);

ETimingConstraintViolation: basic type for timing constraintexceptions;

EDeadlineViolation: occurring if try within ortry within abs segment do not make theirdeadlines;

EWCETViolation: occurring if try wcet executes more than howit specified.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 53: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exceptions

Additions to OML:

try within: code segment with relative deadline constraint;

try within abs: code segment with absolute deadline constraint;

try wcet: code segment with maximum allowed execution time(WCET);

ETimingConstraintViolation: basic type for timing constraintexceptions;

EDeadlineViolation: occurring if try within ortry within abs segment do not make theirdeadlines;

EWCETViolation: occurring if try wcet executes more than howit specified.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 54: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exceptions

Additions to OML:

try within: code segment with relative deadline constraint;

try within abs: code segment with absolute deadline constraint;

try wcet: code segment with maximum allowed execution time(WCET);

ETimingConstraintViolation: basic type for timing constraintexceptions;

EDeadlineViolation: occurring if try within ortry within abs segment do not make theirdeadlines;

EWCETViolation: occurring if try wcet executes more than howit specified.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 55: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exceptions

Additions to OML:

try within: code segment with relative deadline constraint;

try within abs: code segment with absolute deadline constraint;

try wcet: code segment with maximum allowed execution time(WCET);

ETimingConstraintViolation: basic type for timing constraintexceptions;

EDeadlineViolation: occurring if try within ortry within abs segment do not make theirdeadlines;

EWCETViolation: occurring if try wcet executes more than howit specified.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 56: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exceptions

Additions to OML:

try within: code segment with relative deadline constraint;

try within abs: code segment with absolute deadline constraint;

try wcet: code segment with maximum allowed execution time(WCET);

ETimingConstraintViolation: basic type for timing constraintexceptions;

EDeadlineViolation: occurring if try within ortry within abs segment do not make theirdeadlines;

EWCETViolation: occurring if try wcet executes more than howit specified.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 57: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exceptions

Additions to OML:

try within: code segment with relative deadline constraint;

try within abs: code segment with absolute deadline constraint;

try wcet: code segment with maximum allowed execution time(WCET);

ETimingConstraintViolation: basic type for timing constraintexceptions;

EDeadlineViolation: occurring if try within ortry within abs segment do not make theirdeadlines;

EWCETViolation: occurring if try wcet executes more than howit specified.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 58: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exceptions

Additions to OML:

try within: code segment with relative deadline constraint;

try within abs: code segment with absolute deadline constraint;

try wcet: code segment with maximum allowed execution time(WCET);

ETimingConstraintViolation: basic type for timing constraintexceptions;

EDeadlineViolation: occurring if try within ortry within abs segment do not make theirdeadlines;

EWCETViolation: occurring if try wcet executes more than howit specified.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 59: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exception Example (I)

#in c l u d e <om l e x c ep t i on s . h>

vo id Decoder {n e x t d l = now ;f o r ( ; ; ) {

n e x t d l = n e x t d l + p e r i o d ;

t r y w i t h i n a b s ( n e x t d l ) {St reamPar se r ( ) ;i f ( FrameDecoder ( ) == 0)

ImagePos tProces s i ng ( ) ;V i s u a l i z a t i o n ( ) ;

}hand l e

when ( EDea d l i n eV i o l a t i o n ) {/∗ e . g . , re−use l a s t decoded frame ∗/

}end ;

}}

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 60: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Timing Exception Example (II)

i n t FrameDecoder ( ){

i n t r v = 0 ; /∗ Normal r e t u r n code ∗/

t r y w c e t (12000) {DecodeAudioFrame ( ) ;DecodeVideoFrame ( ) ;

}hand l e

when ( EWCETViolation ) {/∗ Not i f y c a l l e r o f i n comp l e t e decod ing ∗/r v = −1;

}end ;

r e t u r n r v ;}

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 61: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 62: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 63: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 64: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 65: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 66: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 67: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 68: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 69: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Something About Implementation

Implementation for POSIX standard systems:

sigsetjmp() and siglongjmp() for the base mechanism ofexceptions;

interval timers (itimers) with:

CLOCK MONOTONIC –non decreasing time reference– fordeadline enforcement;CLOCK THREAD CPUTIME ID –thread execution timereference— for wcet enforcement.

real-time signal delivery to “faulting threads” on timer firing:

signals can be temporary blocked, but no delivery is lost;signals are delivered in the order they have been sent;

Implementation is portable to any really OS providing support forPOSIX real-time extensions.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 70: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 71: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 72: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 73: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 74: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 75: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 76: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 77: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 78: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 79: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 80: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Violation-Notification Precision and Latency

Maximum achievable precision is subject to time-keeping precisionof the underlying OS. On Linux (at least since 2.6.21 kernels) we

have:

hrtimers for CLOCK MONOTONIC based itimers

accounting based for CLOCK THREAD CPUTIME ID baseditimers.

Which means:

hrtimer based timers resolution is:

not related to periodic tick frequency;only dependant on underlying hardware (e.g.,availability of TSC, etc.);

accounting based timers resolution is dependant on accountingevents, i.e. at:

each periodic tick (every 10, 4 or 1 msec);each scheduling event (en/de-queue,preemption, etc.)

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 81: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Benchmarking and Non-Interruptible Modes

Benchmarking operational mode: Compile-time switch areprovided for gathering information on the duration oftry...handle segments, instead of constraintenforcement.

Non-Interruptible code sections: Simply temporary blocking signaldelivery is all it is needed to protect a code segmentfrom being interrupted by a constraint violationnotification.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 82: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Benchmarking and Non-Interruptible Modes

Benchmarking operational mode: Compile-time switch areprovided for gathering information on the duration oftry...handle segments, instead of constraintenforcement.

Non-Interruptible code sections: Simply temporary blocking signaldelivery is all it is needed to protect a code segmentfrom being interrupted by a constraint violationnotification.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 83: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Benchmarking and Non-Interruptible Modes

Benchmarking operational mode: Compile-time switch areprovided for gathering information on the duration oftry...handle segments, instead of constraintenforcement.

Non-Interruptible code sections: Simply temporary blocking signaldelivery is all it is needed to protect a code segmentfrom being interrupted by a constraint violationnotification.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 84: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (I)

Direct signal delivery to a specific thread is not covered by POSIX:

signals reach a whole process,

they may be delivered to anyone of the threads that does notblock it,

impossible to know in advance which thread will receive andhandle it.

Two solutions are possible:

POSIX compliant: have a special thread responsible for gettingand distributing it to its legitimate recipient.

Linux specific: non-standard direct signal delivery to a specificthread is possible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 85: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (I)

Direct signal delivery to a specific thread is not covered by POSIX:

signals reach a whole process,

they may be delivered to anyone of the threads that does notblock it,

impossible to know in advance which thread will receive andhandle it.

Two solutions are possible:

POSIX compliant: have a special thread responsible for gettingand distributing it to its legitimate recipient.

Linux specific: non-standard direct signal delivery to a specificthread is possible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 86: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (I)

Direct signal delivery to a specific thread is not covered by POSIX:

signals reach a whole process,

they may be delivered to anyone of the threads that does notblock it,

impossible to know in advance which thread will receive andhandle it.

Two solutions are possible:

POSIX compliant: have a special thread responsible for gettingand distributing it to its legitimate recipient.

Linux specific: non-standard direct signal delivery to a specificthread is possible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 87: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (I)

Direct signal delivery to a specific thread is not covered by POSIX:

signals reach a whole process,

they may be delivered to anyone of the threads that does notblock it,

impossible to know in advance which thread will receive andhandle it.

Two solutions are possible:

POSIX compliant: have a special thread responsible for gettingand distributing it to its legitimate recipient.

Linux specific: non-standard direct signal delivery to a specificthread is possible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 88: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (I)

Direct signal delivery to a specific thread is not covered by POSIX:

signals reach a whole process,

they may be delivered to anyone of the threads that does notblock it,

impossible to know in advance which thread will receive andhandle it.

Two solutions are possible:

POSIX compliant: have a special thread responsible for gettingand distributing it to its legitimate recipient.

Linux specific: non-standard direct signal delivery to a specificthread is possible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 89: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (I)

Direct signal delivery to a specific thread is not covered by POSIX:

signals reach a whole process,

they may be delivered to anyone of the threads that does notblock it,

impossible to know in advance which thread will receive andhandle it.

Two solutions are possible:

POSIX compliant: have a special thread responsible for gettingand distributing it to its legitimate recipient.

Linux specific: non-standard direct signal delivery to a specificthread is possible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 90: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (I)

Direct signal delivery to a specific thread is not covered by POSIX:

signals reach a whole process,

they may be delivered to anyone of the threads that does notblock it,

impossible to know in advance which thread will receive andhandle it.

Two solutions are possible:

POSIX compliant: have a special thread responsible for gettingand distributing it to its legitimate recipient.

Linux specific: non-standard direct signal delivery to a specificthread is possible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 91: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (II)

POSIX recommended mechanism:creating a special handling thread at each signal delivery.

Advantages:

standard compliance, i.e. portability.

Drawbacks:

constraint violations are delayed by thread creation latency;

constraint violations entail creation and rapid destruction ofquite a number of threads.

constraint violations may result in up to 3 context switches byitself to be accomplished;

constraint violations notification involves scheduling, i.e. itslatency is dependant on system status actual load.

Implementation is widely portable, but latency between violationand its notification may be not-negligible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 92: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (II)

POSIX recommended mechanism:creating a special handling thread at each signal delivery.

Advantages:

standard compliance, i.e. portability.

Drawbacks:

constraint violations are delayed by thread creation latency;

constraint violations entail creation and rapid destruction ofquite a number of threads.

constraint violations may result in up to 3 context switches byitself to be accomplished;

constraint violations notification involves scheduling, i.e. itslatency is dependant on system status actual load.

Implementation is widely portable, but latency between violationand its notification may be not-negligible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 93: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (II)

POSIX recommended mechanism:creating a special handling thread at each signal delivery.

Advantages:

standard compliance, i.e. portability.

Drawbacks:

constraint violations are delayed by thread creation latency;

constraint violations entail creation and rapid destruction ofquite a number of threads.

constraint violations may result in up to 3 context switches byitself to be accomplished;

constraint violations notification involves scheduling, i.e. itslatency is dependant on system status actual load.

Implementation is widely portable, but latency between violationand its notification may be not-negligible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 94: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (II)

POSIX recommended mechanism:creating a special handling thread at each signal delivery.

Advantages:

standard compliance, i.e. portability.

Drawbacks:

constraint violations are delayed by thread creation latency;

constraint violations entail creation and rapid destruction ofquite a number of threads.

constraint violations may result in up to 3 context switches byitself to be accomplished;

constraint violations notification involves scheduling, i.e. itslatency is dependant on system status actual load.

Implementation is widely portable, but latency between violationand its notification may be not-negligible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 95: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (II)

POSIX recommended mechanism:creating a special handling thread at each signal delivery.

Advantages:

standard compliance, i.e. portability.

Drawbacks:

constraint violations are delayed by thread creation latency;

constraint violations entail creation and rapid destruction ofquite a number of threads.

constraint violations may result in up to 3 context switches byitself to be accomplished;

constraint violations notification involves scheduling, i.e. itslatency is dependant on system status actual load.

Implementation is widely portable, but latency between violationand its notification may be not-negligible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 96: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (II)

POSIX recommended mechanism:creating a special handling thread at each signal delivery.

Advantages:

standard compliance, i.e. portability.

Drawbacks:

constraint violations are delayed by thread creation latency;

constraint violations entail creation and rapid destruction ofquite a number of threads.

constraint violations may result in up to 3 context switches byitself to be accomplished;

constraint violations notification involves scheduling, i.e. itslatency is dependant on system status actual load.

Implementation is widely portable, but latency between violationand its notification may be not-negligible.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 97: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (III)

Linux specific mechanism:Exploit non-standard –enabled on Linux– possibility of specificthread itimer signal delivery.

Advantages:

time between violation and notification is as tight as possible.

Drawbacks:

exploits a non-standard Linux specific extension.

Constraint violation latency is kept low, but the resulting code onlyruns on Linux.

In this preliminary work, only this solution is being analyzed.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 98: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (III)

Linux specific mechanism:Exploit non-standard –enabled on Linux– possibility of specificthread itimer signal delivery.

Advantages:

time between violation and notification is as tight as possible.

Drawbacks:

exploits a non-standard Linux specific extension.

Constraint violation latency is kept low, but the resulting code onlyruns on Linux.

In this preliminary work, only this solution is being analyzed.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 99: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (III)

Linux specific mechanism:Exploit non-standard –enabled on Linux– possibility of specificthread itimer signal delivery.

Advantages:

time between violation and notification is as tight as possible.

Drawbacks:

exploits a non-standard Linux specific extension.

Constraint violation latency is kept low, but the resulting code onlyruns on Linux.

In this preliminary work, only this solution is being analyzed.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 100: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (III)

Linux specific mechanism:Exploit non-standard –enabled on Linux– possibility of specificthread itimer signal delivery.

Advantages:

time between violation and notification is as tight as possible.

Drawbacks:

exploits a non-standard Linux specific extension.

Constraint violation latency is kept low, but the resulting code onlyruns on Linux.

In this preliminary work, only this solution is being analyzed.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 101: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (III)

Linux specific mechanism:Exploit non-standard –enabled on Linux– possibility of specificthread itimer signal delivery.

Advantages:

time between violation and notification is as tight as possible.

Drawbacks:

exploits a non-standard Linux specific extension.

Constraint violation latency is kept low, but the resulting code onlyruns on Linux.

In this preliminary work, only this solution is being analyzed.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 102: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (III)

Linux specific mechanism:Exploit non-standard –enabled on Linux– possibility of specificthread itimer signal delivery.

Advantages:

time between violation and notification is as tight as possible.

Drawbacks:

exploits a non-standard Linux specific extension.

Constraint violation latency is kept low, but the resulting code onlyruns on Linux.

In this preliminary work, only this solution is being analyzed.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 103: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Sending the signal to the Correct Thread (III)

Linux specific mechanism:Exploit non-standard –enabled on Linux– possibility of specificthread itimer signal delivery.

Advantages:

time between violation and notification is as tight as possible.

Drawbacks:

exploits a non-standard Linux specific extension.

Constraint violation latency is kept low, but the resulting code onlyruns on Linux.

In this preliminary work, only this solution is being analyzed.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 104: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-Up (I)

Proposed mechanism is effective if occurrence-to-notification of aviolation is small –at least compared with timing characteristics ofthe application–.

Results gathered from preliminary implementation on Linux:

common desktop PC: 3.0 GHz Intel CPU, 2 GB RAM,hand-tailored 2.6.28 Linux kernel;

one task implemented by a Linux thread running 1000instances;

task τ parameters: (C ,D,T ) = (50, 50, 100) msec ;

kernel periodic tick frequency configured to 100, 250 and1000 Hz ;

1000 independent runs for each tick frequency value;

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 105: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-Up (I)

Proposed mechanism is effective if occurrence-to-notification of aviolation is small –at least compared with timing characteristics ofthe application–.

Results gathered from preliminary implementation on Linux:

common desktop PC: 3.0 GHz Intel CPU, 2 GB RAM,hand-tailored 2.6.28 Linux kernel;

one task implemented by a Linux thread running 1000instances;

task τ parameters: (C ,D,T ) = (50, 50, 100) msec ;

kernel periodic tick frequency configured to 100, 250 and1000 Hz ;

1000 independent runs for each tick frequency value;

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 106: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-Up (I)

Proposed mechanism is effective if occurrence-to-notification of aviolation is small –at least compared with timing characteristics ofthe application–.

Results gathered from preliminary implementation on Linux:

common desktop PC: 3.0 GHz Intel CPU, 2 GB RAM,hand-tailored 2.6.28 Linux kernel;

one task implemented by a Linux thread running 1000instances;

task τ parameters: (C ,D,T ) = (50, 50, 100) msec ;

kernel periodic tick frequency configured to 100, 250 and1000 Hz ;

1000 independent runs for each tick frequency value;

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 107: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-Up (I)

Proposed mechanism is effective if occurrence-to-notification of aviolation is small –at least compared with timing characteristics ofthe application–.

Results gathered from preliminary implementation on Linux:

common desktop PC: 3.0 GHz Intel CPU, 2 GB RAM,hand-tailored 2.6.28 Linux kernel;

one task implemented by a Linux thread running 1000instances;

task τ parameters: (C ,D,T ) = (50, 50, 100) msec ;

kernel periodic tick frequency configured to 100, 250 and1000 Hz ;

1000 independent runs for each tick frequency value;

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 108: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-Up (I)

Proposed mechanism is effective if occurrence-to-notification of aviolation is small –at least compared with timing characteristics ofthe application–.

Results gathered from preliminary implementation on Linux:

common desktop PC: 3.0 GHz Intel CPU, 2 GB RAM,hand-tailored 2.6.28 Linux kernel;

one task implemented by a Linux thread running 1000instances;

task τ parameters: (C ,D,T ) = (50, 50, 100) msec ;

kernel periodic tick frequency configured to 100, 250 and1000 Hz ;

1000 independent runs for each tick frequency value;

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 109: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-Up (I)

Proposed mechanism is effective if occurrence-to-notification of aviolation is small –at least compared with timing characteristics ofthe application–.

Results gathered from preliminary implementation on Linux:

common desktop PC: 3.0 GHz Intel CPU, 2 GB RAM,hand-tailored 2.6.28 Linux kernel;

one task implemented by a Linux thread running 1000instances;

task τ parameters: (C ,D,T ) = (50, 50, 100) msec ;

kernel periodic tick frequency configured to 100, 250 and1000 Hz ;

1000 independent runs for each tick frequency value;

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 110: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-Up (I)

Proposed mechanism is effective if occurrence-to-notification of aviolation is small –at least compared with timing characteristics ofthe application–.

Results gathered from preliminary implementation on Linux:

common desktop PC: 3.0 GHz Intel CPU, 2 GB RAM,hand-tailored 2.6.28 Linux kernel;

one task implemented by a Linux thread running 1000instances;

task τ parameters: (C ,D,T ) = (50, 50, 100) msec ;

kernel periodic tick frequency configured to 100, 250 and1000 Hz ;

1000 independent runs for each tick frequency value;

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 111: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-UP (II)

Experiments description:

Deadline violation latency meas.: τ forced to execute more than 50msec inside a try within block. Difference between

ideal and actual violation notification is measured.

WCET violation latency meas.: τ forced to execute more than 50msec inside a try wcet block. Difference between

ideal and actual violation notification is measured.

Results presentation:

tables with maximum, average and standard deviation oflatency values for both experiments. (Minimum values are notinteresting;)

cumulative distribution function (CDF) of latency values forboth experiments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 112: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-UP (II)

Experiments description:

Deadline violation latency meas.: τ forced to execute more than 50msec inside a try within block. Difference between

ideal and actual violation notification is measured.

WCET violation latency meas.: τ forced to execute more than 50msec inside a try wcet block. Difference between

ideal and actual violation notification is measured.

Results presentation:

tables with maximum, average and standard deviation oflatency values for both experiments. (Minimum values are notinteresting;)

cumulative distribution function (CDF) of latency values forboth experiments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 113: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-UP (II)

Experiments description:

Deadline violation latency meas.: τ forced to execute more than 50msec inside a try within block. Difference between

ideal and actual violation notification is measured.

WCET violation latency meas.: τ forced to execute more than 50msec inside a try wcet block. Difference between

ideal and actual violation notification is measured.

Results presentation:

tables with maximum, average and standard deviation oflatency values for both experiments. (Minimum values are notinteresting;)

cumulative distribution function (CDF) of latency values forboth experiments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 114: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-UP (II)

Experiments description:

Deadline violation latency meas.: τ forced to execute more than 50msec inside a try within block. Difference between

ideal and actual violation notification is measured.

WCET violation latency meas.: τ forced to execute more than 50msec inside a try wcet block. Difference between

ideal and actual violation notification is measured.

Results presentation:

tables with maximum, average and standard deviation oflatency values for both experiments. (Minimum values are notinteresting;)

cumulative distribution function (CDF) of latency values forboth experiments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 115: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-UP (II)

Experiments description:

Deadline violation latency meas.: τ forced to execute more than 50msec inside a try within block. Difference between

ideal and actual violation notification is measured.

WCET violation latency meas.: τ forced to execute more than 50msec inside a try wcet block. Difference between

ideal and actual violation notification is measured.

Results presentation:

tables with maximum, average and standard deviation oflatency values for both experiments. (Minimum values are notinteresting;)

cumulative distribution function (CDF) of latency values forboth experiments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 116: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-UP (II)

Experiments description:

Deadline violation latency meas.: τ forced to execute more than 50msec inside a try within block. Difference between

ideal and actual violation notification is measured.

WCET violation latency meas.: τ forced to execute more than 50msec inside a try wcet block. Difference between

ideal and actual violation notification is measured.

Results presentation:

tables with maximum, average and standard deviation oflatency values for both experiments. (Minimum values are notinteresting;)

cumulative distribution function (CDF) of latency values forboth experiments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 117: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Set-UP (II)

Experiments description:

Deadline violation latency meas.: τ forced to execute more than 50msec inside a try within block. Difference between

ideal and actual violation notification is measured.

WCET violation latency meas.: τ forced to execute more than 50msec inside a try wcet block. Difference between

ideal and actual violation notification is measured.

Results presentation:

tables with maximum, average and standard deviation oflatency values for both experiments. (Minimum values are notinteresting;)

cumulative distribution function (CDF) of latency values forboth experiments.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 118: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (I)

Deadline violation notification latency measuring results (in nsec):

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 119: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (I)

Deadline violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 28610 1724.418 1187.854HZ=250 17202 1595.095 711.1304HZ=1000 33394 1602.544 1023.255

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 120: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (I)

Deadline violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 28610 1724.418 1187.854HZ=250 17202 1595.095 711.1304HZ=1000 33394 1602.544 1023.255

0

0.2

0.4

0.6

0.8

1

1.2

0 5000 10000 15000 20000 25000 30000 35000

Pro

b{D

eadl

ine

Late

ncy

<=

t}

t

HZ=100HZ=250

HZ=1000

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 121: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (I)

Deadline violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 28610 1724.418 1187.854HZ=250 17202 1595.095 711.1304HZ=1000 33394 1602.544 1023.255

0

0.2

0.4

0.6

0.8

1

1.2

0 5000 10000 15000 20000 25000 30000 35000

Pro

b{D

eadl

ine

Late

ncy

<=

t}

t

HZ=100HZ=250

HZ=1000

deadline latency is always quite small (1.5 µs over 50 ms);

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 122: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (I)

Deadline violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 28610 1724.418 1187.854HZ=250 17202 1595.095 711.1304HZ=1000 33394 1602.544 1023.255

0

0.2

0.4

0.6

0.8

1

1.2

0 5000 10000 15000 20000 25000 30000 35000

Pro

b{D

eadl

ine

Late

ncy

<=

t}

t

HZ=100HZ=250

HZ=1000

deadline latency is always quite small (1.5 µs over 50 ms);deadline latency is independent on tick frequency.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 123: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (II)

WCET violation notification latency measuring results (in nsec):

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 124: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (II)

WCET violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 18727747 5748948.344 4474771.769HZ=250 4423164 1233955.255 844593.486HZ=1000 1999752 522228.673 390837.341

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 125: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (II)

WCET violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 18727747 5748948.344 4474771.769HZ=250 4423164 1233955.255 844593.486HZ=1000 1999752 522228.673 390837.341

0

0.2

0.4

0.6

0.8

1

1.2

0 2e+06 4e+06 6e+06 8e+06 1e+07 1.2e+07 1.4e+07 1.6e+07 1.8e+07 2e+07

Pro

b{W

CE

T L

aten

cy <

= t}

t

HZ=100HZ=250

HZ=1000

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 126: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (II)

WCET violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 18727747 5748948.344 4474771.769HZ=250 4423164 1233955.255 844593.486HZ=1000 1999752 522228.673 390837.341

0

0.2

0.4

0.6

0.8

1

1.2

0 2e+06 4e+06 6e+06 8e+06 1e+07 1.2e+07 1.4e+07 1.6e+07 1.8e+07 2e+07

Pro

b{W

CE

T L

aten

cy <

= t}

t

HZ=100HZ=250

HZ=1000

WCET latency is much more bigger (0.5 ms over 50 ms);

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 127: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Experimental Results (II)

WCET violation notification latency measuring results (in nsec):

max mean std. dev.

HZ=100 18727747 5748948.344 4474771.769HZ=250 4423164 1233955.255 844593.486HZ=1000 1999752 522228.673 390837.341

0

0.2

0.4

0.6

0.8

1

1.2

0 2e+06 4e+06 6e+06 8e+06 1e+07 1.2e+07 1.4e+07 1.6e+07 1.8e+07 2e+07

Pro

b{W

CE

T L

aten

cy <

= t}

t

HZ=100HZ=250

HZ=1000

WCET latency is much more bigger (0.5 ms over 50 ms);WCET latency is very dependent on tick frequency.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 128: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Conclusions

A set of linguistic constructs for the management of timingconstraints during application design and implementation has beenproposed. applications has been introduced.

Developers can thus focus on the main application flow: timingviolation are catched dynamically by the framework.

Preliminary implementation of the framework on Linux.

Conclusions:

dealing with timing violation as exceptions is viable aneffective approach;

the latency introduced is pretty small, especially for deadlineconstraints.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 129: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Conclusions

A set of linguistic constructs for the management of timingconstraints during application design and implementation has beenproposed. applications has been introduced.

Developers can thus focus on the main application flow: timingviolation are catched dynamically by the framework.

Preliminary implementation of the framework on Linux.

Conclusions:

dealing with timing violation as exceptions is viable aneffective approach;

the latency introduced is pretty small, especially for deadlineconstraints.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 130: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Conclusions

A set of linguistic constructs for the management of timingconstraints during application design and implementation has beenproposed. applications has been introduced.

Developers can thus focus on the main application flow: timingviolation are catched dynamically by the framework.

Preliminary implementation of the framework on Linux.

Conclusions:

dealing with timing violation as exceptions is viable aneffective approach;

the latency introduced is pretty small, especially for deadlineconstraints.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 131: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Conclusions

A set of linguistic constructs for the management of timingconstraints during application design and implementation has beenproposed. applications has been introduced.

Developers can thus focus on the main application flow: timingviolation are catched dynamically by the framework.

Preliminary implementation of the framework on Linux.

Conclusions:

dealing with timing violation as exceptions is viable aneffective approach;

the latency introduced is pretty small, especially for deadlineconstraints.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 132: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Conclusions

A set of linguistic constructs for the management of timingconstraints during application design and implementation has beenproposed. applications has been introduced.

Developers can thus focus on the main application flow: timingviolation are catched dynamically by the framework.

Preliminary implementation of the framework on Linux.

Conclusions:

dealing with timing violation as exceptions is viable aneffective approach;

the latency introduced is pretty small, especially for deadlineconstraints.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 133: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Conclusions

A set of linguistic constructs for the management of timingconstraints during application design and implementation has beenproposed. applications has been introduced.

Developers can thus focus on the main application flow: timingviolation are catched dynamically by the framework.

Preliminary implementation of the framework on Linux.

Conclusions:

dealing with timing violation as exceptions is viable aneffective approach;

the latency introduced is pretty small, especially for deadlineconstraints.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 134: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Future Work

Future work:

investigate on combined user-kernel mechanism to furtherlower the introduced latency, especially for the WCET case(on Linux);

thoroughly compare the POSIX variant of the frameworkimplementation with the Linux-specific one (on Linux!);

test the performance of the POSIX variant of the frameworkon OSes different than Linux;

realize thorough performance comparison between ourframework and the existing ones in RTSJ and Ada 2005.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 135: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Future Work

Future work:

investigate on combined user-kernel mechanism to furtherlower the introduced latency, especially for the WCET case(on Linux);

thoroughly compare the POSIX variant of the frameworkimplementation with the Linux-specific one (on Linux!);

test the performance of the POSIX variant of the frameworkon OSes different than Linux;

realize thorough performance comparison between ourframework and the existing ones in RTSJ and Ada 2005.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 136: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Future Work

Future work:

investigate on combined user-kernel mechanism to furtherlower the introduced latency, especially for the WCET case(on Linux);

thoroughly compare the POSIX variant of the frameworkimplementation with the Linux-specific one (on Linux!);

test the performance of the POSIX variant of the frameworkon OSes different than Linux;

realize thorough performance comparison between ourframework and the existing ones in RTSJ and Ada 2005.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 137: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Future Work

Future work:

investigate on combined user-kernel mechanism to furtherlower the introduced latency, especially for the WCET case(on Linux);

thoroughly compare the POSIX variant of the frameworkimplementation with the Linux-specific one (on Linux!);

test the performance of the POSIX variant of the frameworkon OSes different than Linux;

realize thorough performance comparison between ourframework and the existing ones in RTSJ and Ada 2005.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 138: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Future Work

Future work:

investigate on combined user-kernel mechanism to furtherlower the introduced latency, especially for the WCET case(on Linux);

thoroughly compare the POSIX variant of the frameworkimplementation with the Linux-specific one (on Linux!);

test the performance of the POSIX variant of the frameworkon OSes different than Linux;

realize thorough performance comparison between ourframework and the existing ones in RTSJ and Ada 2005.

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo

Page 139: Exception-Based Management of Timing Constraints Violations · 2009. 7. 14. · Exception-based management approach: mechanism similar to exception management in C++, Java or Ada,

Thank You for Your Time...

Questions?

T. Cucinotta, D. Faggioli ReTiS Lab, Scuola Superiore Sant’Anna, CEIIC via G. Moruzzi 1,56124 Pisa (Italy) {t.cucinotta, d.faggioliException-Based Management of Timing Constraints Violations fo