1 Predictable Java Java Objekt 2, 19 August 2009 Anders P. Ravn and Hans Søndergaard Overview Implementations Next steps.

Slides:



Advertisements
Similar presentations
Real Time Versions of Linux Operating System Present by Tr n Duy Th nh Quách Phát Tài 1.
Advertisements

Introduction to Embedded Systems Resource Management - III Lecture 19.
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 8 SCHEDULING.
The eCos real-time operating system an open source tool to create embedded kernels and applications.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Exception Handling – illustrated by Java mMIC-SFT November 2003 Anders P. Ravn Aalborg University.
1 Maximize Java Performance by using YOURKIT with uPortal development Faizan Ahmed – Sr. Application Developer.
Scheduling Theory ITV Real-Time Systems Anders P. Ravn Aalborg University March 2007.
Extensible Kernels Edgar Velázquez-Armendáriz September 24 th 2009.
Programming R-T Abstractions TSW November 2009 Anders P. Ravn Aalborg University.
Chapter 13 Embedded Systems Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Copyright © 2001Page Real-Time Java Fact-no-fiction Java in technical automation Paul Wijntjes Consultant Turnkiek Technical Systems.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Principles of Object-Oriented Software Development The language Java.
Scheduling Theory ITV Multiprogramming and Real-Time Programs Anders P. Ravn Aalborg University May 2009.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Chapter 13 Embedded Systems
© Andy Wellings, 2003 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Low-level Programming TSW November 2009 Anders P. Ravn Aalborg University.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Chapter 6 Implementing Processes, Threads, and Resources.
Multithreading in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CprE 458/558: Real-Time Systems
The Real-Time Java Profile ITV Real-Time Systems Anders P. Ravn Aalborg University February 2006.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Cyclic Scheduling –Advantages Simple implementation (no real-time operating system is required). Low run-time overhead. It allows jitter control. –Disadvantages.
Memory Management for Real-Time Java Wes Beebee and Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Supported by: DARPA.
Dreams in a Nutshell Steven Sommer Microsoft Research Institute Department of Computing Macquarie University.
A Portable Virtual Machine for Program Debugging and Directing Camil Demetrescu University of Rome “La Sapienza” Irene Finocchi University of Rome “Tor.
A Safety-Critical Java Technology Compatibility Kit Hans Søndergaard Stephan Korsholm VIA University College, Horsens, Denmark & Anders P. Ravn Aalborg.
Chapter 4: Threads. 4.2CSCI 380 Operating Systems Chapter 4: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 4: Threads CS 170 T Yang, Sept 2012.
Real-Time Java Martin Schöberl. Real Time Java2 Overview What are real-time systems Real-time specification for Java RTSJ issues, subset Real-time profile.
Tittle:Real Time Linux
Compilation Technology © 2007 IBM Corporation CGO Performance Overheads In Real-Time Java Programs Mark Stoodley and Mike Fulton Compilation.
Real-Time Java on JOP Martin Schöberl. Real-Time Java on JOP2 Overview RTSJ – why not Simple RT profile Scheduler implementation User defined scheduling.
Xenomai’s Porting on processor NIOS II Professor : P. Kadionik Authors : Bassi Vincent Louati Azza Mirault Raphael Polette Simon.
Instructore: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and.
Enhancements to Java for Real Time Systems Theresa Dsena CSE Fall 2006 Prof. Ganesan.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
Advanced Design and System Patterns The Microkernel Pattern.
Prepare by : Ihab shahtout.  Overview  To give an overview of fixed priority schedule  Scheduling and Fixed Priority Scheduling.
1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his.
EEL The Real-Time Specification for Java (1)
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
EEL Real-time Java part 2. EEL Acknowledgements All the lecture slides were adopted from the slides of Andy Wellings.
Concurrency Control 1 Fall 2014 CS7020: Game Design and Development.
111 G53SRP: RTSJ Memory Areas Chris Greenhalgh School of Computer Science.
CSCI1600: Embedded and Real Time Software Lecture 18: Real Time Languages Steven Reiss, Fall 2015.
Overview of Operating Systems Introduction to Operating Systems: Module 0.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Thread Scheduling and Dispatching Maung Aung Han Marc E. Loy Jihua Zhong CIS 642: Seminar in Real-time Systems Instructor: Professor Insup Lee.
How to Compile Aspects with Real-Time Java Pengcheng Wu Northeastern University Mar. 14, 2005 FOAL Workshop with AOSD’05.
Windows CE Portable Modular Real-time Small footprint Embedded market.
Real-Time Operating System Design
REAL-TIME OPERATING SYSTEMS
Introduction to the CVM and the Timesys RI
Chapter 4: Threads.
Chapter 5: Threads Overview Multithreading Models Threading Issues
G53SRP: Real Time Threads in RTSJ (part I)
Chapter 4: Threads.
CSCI1600: Embedded and Real Time Software
G53SRP: Asynchronous Events in RTSJ
null, true, and false are also reserved.
Real Time Java : Synchronization
CSCI1600: Embedded and Real Time Software
Java Chapter 3 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

1 Predictable Java Java Objekt 2, 19 August 2009 Anders P. Ravn and Hans Søndergaard Overview Implementations Next steps

A Real-Time Application Periodic Event Handlers Aperiodic Event Handlers collected in a mission Mission Handler Each handler  has a Memory  is Scheduled 2

Periodic handler class Periodic extends PeriodicEventHandler { protected Periodic(.., PeriodicParameters pp, Scheduler scheduler, MemoryArea memory); public void handleEvent() { // the logic to be executed every period } 3

Aperiodic handler class Aperiodic extends AperiodicEventHandler { protected Aperiodic(.., AperiodicParameters ap, Scheduler scheduler, MemoryArea memory); public void handleEvent() { // the logic to be executed when an event occurs } 4

A simple mission public class Basic extends Mission { protected Basic(.., AperiodicParameters ap, Scheduler scheduler, MemoryArea memoryArea) {... // initialization } public static void main (String[] args) { new Basic( null, null, new CyclicScheduler(), new LTMemory(10*1024)); } 5

…The mission addToMission( new Periodic( null, pp, getScheduler(), new LTMemory(1024))); addToMission( new Periodic( null, pp, getScheduler(), new LTMemory(1024)));... add(); // mission to its scheduler 6

Complex mission private Mission[] mission; private int active = 0; static AperiodicEvent event; public ThreeSequentialMissions(...) { mission = new Mission[3]; // set up the three missions mission[0] = new Mission(...); // add handlers for mission 0 // including the mission termination... mission[1] = new Mission();... // start the first mission mission[active].add(); event = new AperiodicEvent(this); } 7

Changing mission private Mission[] mission; private int active = 0; static AperiodicEvent event; public ThreeSequentialMissions(...) {... } public void handleEvent() { mission[active].remove(); active = (active + 1) % mission.length; mission[active].add(); } 8

Level 0 9 only Periodic Event Handlers cyclic scheduler

Level 1 10 periodic and aperiodic event handlers fixed-priority preemptive scheduler SO 3 has the highest priority

Implementations On top of RTSJ (adapter) Native implementation using –JamVM –Xenomai/Linux –Mechatronic Brick 11

Schedulers Cyclic scheduler –Only one mission, with periodic handlers –Using cyclic executive model –The Scheduler: a periodic RT_TASK period = gcd of all the handler periods Fixed priority pre-emptive scheduler –Missions with periodic and aperiodic handlers –Implemented as RT_TASKs 12

Memory No GC Two types of memory –Immortal memory = Heap (without GC) Lifetime = lifetime of the application –Scoped memory Each handler has its own private memory Lifetime = lifetime of the handler Object allocation rewritten in JamVM 13

Synchronization Java’s locking model (synchronization) –does not fit to avoid priority inversion Xenomai's MUTEX enforce priority inheritance Rewritten JamVM –synchronized methods in classes for shared objects: uses MUTEX lock/unlock 14

Next steps: Workbench 15

Next steps Eclipse plugins Homepage for Predictable Java Different tools for static analysis Examples... 16

17 References A predictable Java profile - rationale and implementations Thomas Bøgholm, René R. Hansen, Anders P. Ravn, Bent Thomsen, and Hans Søndergaard JTRES’ September Safety-Critical Java JSR 302: Safety Critical Java Technology Java for Safety-Critical Applications Thomas Henties, James J. Hunt, Doug Locke, Kelvin Nilsen, Martin Schoeberl, Jan Vitek. SafeSert Safety Critical Specification for Java Version 0.5. August Draft.

Periodic event handler execution Periodic Rt_task: for (;;) { JNI-callback-to-scheduler-dispatch(handlerNo) rt_task_wait_period(NULL); } class PriorityScheduler extends Scheduler { create Native handlers, start them, etc... void dispatch(int handlerNo) { EventHandler evh = getEvh(handlerNo); evh.getMemoryArea().enter(evh); } public abstract class MemoryArea { long memSize; int memID; // a reference to the MEM_AREA public void enter (Runnable logic) { Native.enterNativeMemArea (memID); logic.run(); Native.leaveNativeMemArea (memID); }... } abstract class PeriodicEventHandler {.. public final void run() { handleEvent(); // abstract method } class MyPeriodicEvH extends PeriodicEventHandler {.. public void handleEvent() { // the logic to be executed every period } 18

19 Xenomai Architecture  Xenomai runs on top of the Linux kernel and handles all incoming interrupts first, before the Linux kernel  Adeos (Adaptive Domain Environment for Operating Systems)  a nanokernel hardware abstraction layer (HAL)  operates between computer hardware and the operating system  Xenomai has some skins  Native, POSIX, etc.

Native Xenomai API RT services for –RT_TASKs rt_task_create, rt_task_start, rt_task_set_priority rt_task_set_periodic, rt_task_wait_period rt_task_suspend, rt_task_resume.. –RT_EVENTs –RT_INTERRUPTs –RT_MUTEXs 20