10
1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh Chris Greenhalgh School of Computer School of Computer Science Science Including material © Andy Wellings from his Including material © Andy Wellings from his site supporting the course text site supporting the course text

1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Embed Size (px)

Citation preview

Page 1: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

1

G53SRP: Introduction to Real Time Specification for Java

(RTSJ)Chris GreenhalghChris Greenhalgh

School of Computer ScienceSchool of Computer ScienceIncluding material © Andy Wellings from his site Including material © Andy Wellings from his site

supporting the course textsupporting the course text

Page 2: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

2

Contents• BackgroundBackground

– NIST requirementsNIST requirements– PrinciplesPrinciples

• OverviewOverview• RTSJ Time-lineRTSJ Time-line• Further readingFurther reading

• Book: Wellings 7 (part)Book: Wellings 7 (part)

Page 3: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Background and NIST Requirements

• In the late 1990s: US National Institute of In the late 1990s: US National Institute of Standards and Technology (NIST) guiding Standards and Technology (NIST) guiding principles and a set of requirements for real-principles and a set of requirements for real-time extensions to the Java platformtime extensions to the Java platform

• Including: Real-Time Java (RTJ) should Including: Real-Time Java (RTJ) should – take into account current real-time practices and take into account current real-time practices and – facilitate advances in the state of the art of real-facilitate advances in the state of the art of real-

time systems implementation technologytime systems implementation technology

Page 4: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Support for Current State of Practice• Fixed priority and round robin schedulingFixed priority and round robin scheduling• Mutual exclusion locking (avoiding priority inversion)Mutual exclusion locking (avoiding priority inversion)

• Inter-thread communication (e.g. semaphores)Inter-thread communication (e.g. semaphores)

• User-defined interrupt handlers and device drivers — including the User-defined interrupt handlers and device drivers — including the ability to manage interrupts (e.g., enabling and disabling)ability to manage interrupts (e.g., enabling and disabling)

• Timeouts and aborts on running threadsTimeouts and aborts on running threads

The NIST group recognized that profiles of RTJ were necessary in order to cope with the wide variety of potential applications, these included: safety critical, no dynamic loading, and distributed real-time profiles

Page 5: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Implementations must provide• A framework for finding available profilesA framework for finding available profiles

• Bounded preBounded pre--emption latency on any garbage collectionemption latency on any garbage collection

• A well-defined model for real-time Java threadsA well-defined model for real-time Java threads

• Communication and synchronization between real-time and non real-Communication and synchronization between real-time and non real-time threadstime threads

• Mechanisms for handling internal and external asynchronous eventsMechanisms for handling internal and external asynchronous events

• Asynchronous thread terminationAsynchronous thread termination

• Mutual exclusion without blockingMutual exclusion without blocking

• The ability to determine whether the running thread is real-time or non The ability to determine whether the running thread is real-time or non real-timereal-time

• A well-defined relationship between real-time and non real-time A well-defined relationship between real-time and non real-time threadsthreads

Page 6: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

RTSJ Guiding Principles• Be backward compatible with non real-time Java programsBe backward compatible with non real-time Java programs

• Support the principle of “Write Once, Run Anywhere” but Support the principle of “Write Once, Run Anywhere” but not at the expense of predictabilitynot at the expense of predictability

• Address the current real-time system practice and allow Address the current real-time system practice and allow future implementations to include advanced featuresfuture implementations to include advanced features

• Give priority to predictable execution in all design trade-Give priority to predictable execution in all design trade-offsoffs

• Require no syntactic extensions to the Java languageRequire no syntactic extensions to the Java language

• Allow implementers flexibilityAllow implementers flexibility

NB Real Time Java functionality requires Real Time OS Support!

Page 7: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Overview of Enhancements• The RTSJ enhances Java in the following areas:The RTSJ enhances Java in the following areas:

– memory managementmemory management– time values and clockstime values and clocks

– schedulable objects and schedulingschedulable objects and scheduling

– real-time threadsreal-time threads

– asynchronous event handling and timersasynchronous event handling and timers

– asynchronous transfer of controlasynchronous transfer of control

– synchronization and resource sharingsynchronization and resource sharing

– physical memory accessphysical memory access

Page 8: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Warning

To date, RTSJ only really addresses the execution of real-time Java programs on a single processor systems. It attempts not to preclude execution on a shared-memory multiprocessor systems but it has no facilities directly to control, say, allocation of threads to processors.

Page 9: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Real Time Specification for Java (RTSJ) time-line

• Version 1.0 – JSR-1 – 1998-2002Version 1.0 – JSR-1 – 1998-2002– Version 1.0.1 – 2005Version 1.0.1 – 2005– Version 1.0.2 – 2006Version 1.0.2 – 2006

• Version 1.1 – JSR-282 – in progressVersion 1.1 – JSR-282 – in progress– Mainly incremental fixes and enhancementsMainly incremental fixes and enhancements

• but starting to include multi-processor supportbut starting to include multi-processor support

• N.B. RTSJ = N.B. RTSJ = SpecificationSpecification– RI = Reference Implementation (but not only RI = Reference Implementation (but not only

implementation) implementation) 9

Page 10: 1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his

Further Reading• The NIST requirements: Carnahan, L., and Ruark, The NIST requirements: Carnahan, L., and Ruark,

M. (Eds) (1999), “Requirements for Real-time M. (Eds) (1999), “Requirements for Real-time Extensions for the Java Platform”, NIST Extensions for the Java Platform”, NIST Publication 5000-243, http://www.nist.gov/rt-javaPublication 5000-243, http://www.nist.gov/rt-java

• The RTSJ Homepage The RTSJ Homepage http://www.rtsj.org/index.htmlhttp://www.rtsj.org/index.html

• ““JSR-282 Status Report”, JSR-282 Status Report”, http://portal.acm.org/citation.cfm?http://portal.acm.org/citation.cfm?id=1620405.1620431id=1620405.1620431