System and Realtime Programming (G53SRP)

Download Report

Transcript System and Realtime Programming (G53SRP)

G53SRP: Introduction to
Real Time Specification for Java
(RTSJ)
Chris Greenhalgh
School of Computer Science
Including material © Andy Wellings from his site
supporting the course text
1
Contents
• Background
– NIST requirements
– Principles
• Overview
• RTSJ Time-line
• Further reading
• Book: Wellings 7 (part)
2
Background and NIST Requirements
• In the late 1990s: US National Institute of
Standards and Technology (NIST) guiding
principles and a set of requirements for realtime extensions to the Java platform
• Including: Real-Time Java (RTJ) should
– take into account current real-time practices and
– facilitate advances in the state of the art of realtime systems implementation technology
Support for Current State of Practice
• Fixed priority and round robin scheduling
• Mutual exclusion locking (avoiding priority inversion)
• Inter-thread communication (e.g. semaphores)
• User-defined interrupt handlers and device drivers — including the
ability to manage interrupts (e.g., enabling and disabling)
• Timeouts 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
Implementations must provide
•
•
•
•
•
•
•
•
•
A framework for finding available profiles
Bounded pre-emption latency on any garbage collection
A well-defined model for real-time Java threads
Communication and synchronization between real-time and non realtime threads
Mechanisms for handling internal and external asynchronous events
Asynchronous thread termination
Mutual exclusion without blocking
The ability to determine whether the running thread is real-time or non
real-time
A well-defined relationship between real-time and non real-time
threads
RTSJ Guiding Principles
• Be backward compatible with non real-time Java programs
• Support the principle of “Write Once, Run Anywhere” but
not at the expense of predictability
• Address the current real-time system practice and allow
future implementations to include advanced features
• Give priority to predictable execution in all design tradeoffs
• Require no syntactic extensions to the Java language
• Allow implementers flexibility
NB Real Time Java functionality requires Real Time OS Support!
Overview of Enhancements
• The RTSJ enhances Java in the following areas:
– memory management
– time values and clocks
– schedulable objects and scheduling
– real-time threads
– asynchronous event handling and timers
– asynchronous transfer of control
– synchronization and resource sharing
– physical memory access
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.
Real Time Specification for
Java (RTSJ) time-line
• Version 1.0 – JSR-1 – 1998-2002
– Version 1.0.1 – 2005
– Version 1.0.2 – 2006
• Version 1.1 – JSR-282 – in progress
– Mainly incremental fixes and enhancements
• but starting to include multi-processor support
• N.B. RTSJ = Specification
– RI = Reference Implementation (but not only
implementation)
9
Further Reading
• The NIST requirements: Carnahan, L., and Ruark,
M. (Eds) (1999), “Requirements for Real-time
Extensions for the Java Platform”, NIST
Publication 5000-243, http://www.nist.gov/rt-java
• The RTSJ Homepage
http://www.rtsj.org/index.html
• “JSR-282 Status Report”,
http://portal.acm.org/citation.cfm?id=1620405.162
0431