scispace - formally typeset
Open AccessBook ChapterDOI

A Methodology and Tool Support for Generating Scheduled Native Code for Real-Time Java Applications

Reads0
Chats0
TLDR
Current trends in industry are leading towards the use of Java as a programming language for implementing embedded and real-time applications, and the Java environment is indeed a very attractive development framework.
Abstract
Current trends in industry are leading towards the use of Java [5] as a programming language for implementing embedded and real-time applications. From the software engineering perspective, the Java environment is indeed a very attractive development framework. Object-oriented programming provides encapsulation of abstractions into objects that communicate through clearly defined interfaces. Dynamic loading eases the maintenance and improvement of complex applications with evolving requirements and functionality. Besides, Java provides built-in support for multi-threading.

read more

Content maybe subject to copyright    Report

City, University of London Institutional Repository
Citation: Kloukinas, C., Nakhli, C. and Yovine, S. (2003). A Methodology and Tool Support
for Generating Scheduled Native Code for Real-Time Java Applications. Lecture Notes in
Computer Science: Embedded Software, 2855, pp. 274-289. doi: 10.1007/978-3-540-45212-
6_18
This is the unspecified version of the paper.
This version of the publication may differ from the final published
version.
Permanent repository link: https://openaccess.city.ac.uk/id/eprint/2896/
Link to published version: http://dx.doi.org/10.1007/978-3-540-45212-6_18
Copyright: City Research Online aims to make research outputs of City,
University of London available to a wider audience. Copyright and Moral
Rights remain with the author(s) and/or copyright holders. URLs from
City Research Online may be freely distributed and linked to.
Reuse: Copies of full items can be used for personal research or study,
educational, or not-for-profit purposes without prior permission or
charge. Provided that the authors, title and full bibliographic details are
credited, a hyperlink and/or URL is given for the original metadata page
and the content is not changed in any way.
City Research Online

City Research Online: http://openaccess.city.ac.uk/ publications@city.ac.uk

A methodology and tool support for generating
scheduled native code for real-time Java applications
?
Christos Kloukinas Chaker Nakhli Sergio Yovine
VERIMAG
Centre Equation, 2 Ave. Vignate, 38610 Gi
`
eres, France
{Christos.Kloukinas,Chaker.Nakhli,Sergio.Yovine}@imag.fr
1 Introduction
Current trends in industry are leading towards the use of Java [5] as a programming
language for implementing embedded and real-time applications. From the software
engineering perspective, the Java environment is indeed a very attractive development
framework. Object-oriented programming provides encapsulation of abstractions into
objects that communicate through clearly defined interfaces. Dynamic loading eases
the maintenance and improvement of complex applications with evolving requirements
and functionality. Besides, Java provides built-in support for multi-threading.
However, the semantics of Java do not guarantee a predictable run-time behavior,
which is an essential issue in embedded real-time software. To overcome this problem,
work has been done to extend the language and the platform to accommodate to the
requirements of real-time systems by focusing on current practices. Among such work,
we should mention the Real-Time Specification for Java [11], and the Real-Time Core
Extension for the Java Platform [12], that provide support for real-time programming
(timers, clocks, handlers, priorities, ... ). Still, these extensions leave some important is-
sues unspecified, like the scheduling algorithm to be used, allowing an implementation
to resolve them at will.
In order to obtain more precise semantics, domain-specific profiles have also been
defined, such as the Ravenscar-Java [8] high-integrity profile for safety-critical sys-
tems. This profile settles an execution model based on a two/three-phase program ex-
ecution, comprising an initialization phase and a mission phase (possibly followed by
a termination phase), and multi-threading semantics relying on fixed priority preemp-
tive scheduling and priority ceiling inheritance. Though designed to ease analysis and
programming, this profile still has some drawbacks. For instance, it does not directly
support threads which synchronize and communicate using the wait and notify
methods of Java. Besides, the underlying schedulability analysis is pessimistic by na-
ture and not well adapted for systems with heterogeneous tasks and constraints.
The other important issue is performance. Though there are efforts to produce effi-
cient implementations of Java Virtual Machines (e.g., [1,15]), the slowdown due to the
VM remains an argument against adopting Java for real-time applications. Real-time
systems can afford neither the overhead nor the non-determinism of using a Just-In-
Time (JIT) compiler (e.g., [3,14]). An alternative approach consists in using an Ahead-
?
Partially supported by the RNTL project Expresso (http://www.irisa.fr/rntl-expresso).

of-Time (AOT) compiler (e.g., [10,17]) to generate executable code for a run-time sys-
tem and to provide a native implementation of the real-time primitives. A major advan-
tage of AOT compilation is that it allows performing sophisticated analysis techniques
to produce highly optimized code.
In this paper we present an approach that takes into account the demands of both
precise semantics and performance. Our work is based on the two/three-phase execution
model and API of the Expresso High-Integrity Profile [4], which itself inherits concepts
from the Ravenscar-Java profile and the RTSJ API. However, the semantics proposed by
the profile do not fit the needs of applications that would demand alternative schedul-
ing and synchronization paradigms, and handling quality of service requirements. To
accommodate to such demands, our approach focuses primarily on the application.
Model
Automata
Timed
Scheduler
Synthesis
Table of
Dynamic
Priorities
Program
Java
Information
WCET
Instrumented
Java
Program
Compiler
Java
TurboJ
Executable
Native
Run−Time
RT OS
(POSIX / eCos)
(per state)
Model
Generator
Scheduler
Support Library
Fig.1. Code analysis & generation chain
Following [13], we first extract a formal model of the behavior of the application
program as an extended automaton (see Fig. 1 & section 2). Then, we synthesize an
application-dependent scheduler (see sections 34) which is safe (i.e., it is deadlock
free and meets all timing constraints) and QoS extendible (i.e., it can be extended to
handle QoS requirements, such as reducing response jitter, power consumption or con-
text switches). This synthesized scheduler is meant to be used with an appropriate native
run-time support we have developed, which itself uses the underlying R-T OSs primi-
tives (see section 5). Our scheduler also needs an instrumented version of the original
Java code (also produced by our model extracting tool), so as to be able to follow

the changes of thread states (i.e., the instrumentation implements an abstract program
counter). The test-bed we have developed has been integrated together with the Ex-
presso High-Integrity API and the TurboJ [17] Java-to-native compiler.
This framework provides a complete analysis and compilation chain for embedded
real-time systems based on Java, allowing one to substitute RMA/EDF & PCP with a
scheduler which is still safe but not as pessimistic. In this article, we describe the model
generator, the scheduler architecture and synthesis methodology, and the prototype test-
bed implemented using POSIX [6] primitives.
We will illustrate our approach throughout the paper with a case study inspired
by the robotic arm system described in [9] (see Fig. 2). The arm is programmed to
take objects from a conveyor belt, to store them in a buffer shelf, and to put them
into a basket. The arm is controlled by threads running on a single processor. The
TrajectoryControl thread reads commands from a shared buffer and issues set-
points to the low-level arm controller Controler. If there are no commands to pro-
cess, it holds, otherwise reads sensor values and computes the new set-point. Its ex-
ecution time is between 5ms and 6ms. The Lifter thread is activated periodically
every 40ms. Its role is to command the arm to pick objects from the conveyor belt.
Upon termination, it issues a command to the TrajectoryControl and activates
the Putter. Its execution time is between 4ms to 8ms. The Putter thread sends com-
mands to take the object from the buffer shelf and put it into the basket. Its execution
time is between 4ms to 8ms. The SensorReader thread reads sensors every 24ms. Its
execution time is 1ms. The results of the sensors are used by TrajectoryControl.
Controler is a periodic thread with period 16ms. Notice in Fig. 2 how, according
to the Expresso HIP-API,
waitForPeriod
returns a boolean value which is
false
if the
thread misses its period. In such a case, the application ends the mission phase and
goes into a termination phase which is omitted here. In this paper we only consider the
problem of synthesizing a scheduler for the mission phase.
The paper is organized as follows. Section 2 presents the technique we use to gen-
erate models from Java source code. Section 3 explains the scheduler architecture and
execution semantics, while section 4 describes our methodology for synthesizing an
application-dependent scheduler. Section 5 discusses our test-bed implementation.
2 Model Generation
We consider real-time Java applications made up of a fixed number of threads that
synchronize and communicate through a fixed set of global shared objects. There is a
distinguished thread, namely Main, which is the first thread to wake up at application
startup and the unique entry-point of the application. We assume that Main is pro-
grammed according to the Expresso HIP, that is, all the shared objects and threads are
created during the initialization phase.
The model of a Java program is a transition system which abstracts program actions
and states. Each state in the model is an abstraction of a program state at run-time. Tran-
sitions are associated with source code and capture the change that its execution makes
to the program state. More formally, let Θ = {th
i
} be a finite set of threads, = {O
i
}
be a finite set of shared objects, and A be a set of labels. Labels may correspond to

Citations
More filters
Proceedings ArticleDOI

An approach to generating C code with proven LTL-based properties

TL;DR: This paper presents a novel approach to software development, mainly useful for embedded devices, that first generates a special verifiable code from the description and proves that it has certain properties defined by LTL formulae.
Proceedings ArticleDOI

Data-mining synthesised schedulers for hard real-time systems

TL;DR: It is shown how one can adapt data-mining techniques to decrease the size of a synthesised scheduler and force its inherent structure to appear, thus giving the system designer a wealth of additional information for understanding and optimising the Scheduler and the underlying system.
Book ChapterDOI

A Geometric Approach to Scheduling of Concurrent Real-time Processes Sharing Resources

Thao Dang, +1 more
TL;DR: This chapter examines the behavior of a class of concurrent processes sharing resources, from the point of view of the worst-case response time (WCRT), and introduces a model, called timed PV diagram, which is inspired by the results in the analysis of concurrent programs using PV diagrams, a model introduced by Dijkstra.
Proceedings ArticleDOI

Scheduling for multi-threaded real-time programs via path planning

TL;DR: This paper shows a property of the geometrization that permits finding good schedules by means of efficient geometric computation, and exploits this property to reduce the scheduling problem to a simple path planning problem originating from robotics.
Book ChapterDOI

Computing Schedules for Multithreaded Real-Time Programs using Geometry

TL;DR: A timed version for PV programs and diagrams is introduced, which allows us to define the worst-case response time of the schedules, and to use the geometric abstractions for computing efficient schedules.
References
More filters
Book

The Java Language Specification

TL;DR: The Java Language Specification, Second Edition is the definitive technical reference for the Java programming language and provides complete, accurate, and detailed coverage of the syntax and semantics of the Java language.

The instituteof electrical and electronics engineers,inc.

TL;DR: Whenindoubt, sendthe manuscript toE.K.Gannett, Director, Editorial Ser- Advertising Producetion Manager vices, atIEEEHeadquarters, forforwarding tothecorrect party as discussed by the authors.
Book

The Real-Time Specification for Java

TL;DR: RTSJ's features and the thinking behind the specification's design are explained, which aims to provide a platform-a Java execution environment and application program interface (API) that lets programmers correctly reason about the temporal behavior of executing software.
Journal ArticleDOI

Branching time and abstraction in bisimulation semantics

TL;DR: This paper investigates whether observation equivalence really does respect the branching structure of processes, and finds that in the presence of the unobservable action τ of CCS this is not the case, and the notion of branching bisimulation equivalence is introduced which strongly preserves the branching structures of processes.
Trending Questions (1)
Is Java required for software engineering?

From the software engineering perspective, the Java environment is indeed a very attractive development framework.