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.

Slides:



Advertisements
Similar presentations
Introduction CSCI 444/544 Operating Systems Fall 2008.
Advertisements

Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
Introduction to Java Kiyeol Ryu Java Programming Language.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
OS Fall ’ 02 Introduction Operating Systems Fall 2002.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Active Messages: a Mechanism for Integrated Communication and Computation von Eicken et. al. Brian Kazian CS258 Spring 2008.
Processes 1 CS502 Spring 2006 Processes Week 2 – CS 502.
Ritu Varma Roshanak Roshandel Manu Prasanna
OS Spring’03 Introduction Operating Systems Spring 2003.
1 Predictable Java Java Objekt 2, 19 August 2009 Anders P. Ravn and Hans Søndergaard Overview Implementations Next steps.
© Andy Wellings, 2003 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Multithreading in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CprE 458/558: Real-Time Systems
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Chapter 2 Operating System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
JOP: A Java Optimized Processor for Embedded Real-Time Systems Martin Schöberl.
WCET Analysis for a Java Processor Martin Schoeberl TU Vienna, Austria Rasmus Pedersen CBS, Denmark.
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.
Chapter 4 Threads, SMP, and Microkernels Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design.
Compilation Technology © 2007 IBM Corporation CGO Performance Overheads In Real-Time Java Programs Mark Stoodley and Mike Fulton Compilation.
1 Comp 104: Operating Systems Concepts Java Development and Run-Time Store Organisation.
A Time Predictable Instruction Cache for a Java Processor Martin Schoeberl.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Operating Systems. Definition An operating system is a collection of programs that manage the resources of the system, and provides a interface between.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
Enhancements to Java for Real Time Systems Theresa Dsena CSE Fall 2006 Prof. Ganesan.
XOberon CS Fall 2002 Dr. Abzug Jeremy Bruker Jeremy Carbaugh Jeff Hensley Drew Stockdreher.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
1 G53SRP: Introduction to Real Time Specification for Java (RTSJ) Chris Greenhalgh School of Computer Science Including material © Andy Wellings from his.
CS333 Intro to Operating Systems Jonathan Walpole.
EEL The Real-Time Specification for Java (1)
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
Joonwon Lee Process and Address Space.
CSCI1600: Embedded and Real Time Software Lecture 18: Real Time Languages Steven Reiss, Fall 2015.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
On Implementing High Level Concurrency in Java G Stewart von Itzstein Mark Jasiunas University of South Australia.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
6.0 INTRODUCTION TO REAL-TIME OPERATING SYSTEMS (RTOS) 6.0 Introduction A more complex software architecture is needed to handle multiple tasks, coordination,
Unit - I Real Time Operating System. Content : Operating System Concepts Real-Time Tasks Real-Time Systems Types of Real-Time Tasks Real-Time Operating.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
RealTimeSystems Lab Jong-Koo, Lim
Embedded Real-Time Systems
Adding Concurrency to a Programming Language Peter A. Buhr and Glen Ditchfield USENIX C++ Technical Conference, Portland, Oregon, U. S. A., August 1992.
CMSC 421 Spring 2004 Section 0202 Part II: Process Management Chapter 5 Threads.
Real-Time Operating Systems RTOS For Embedded systems.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
(Not too) Real-Time JVM (Progress Report)
Context-related issues in real-time systems
REAL-TIME OPERATING SYSTEMS
Processes and threads.
Process concept.
Before You Begin Nahla Abuel-ola /WIT.
Operating Systems CMPSC 473
Introduction to the CVM and the Timesys RI
CS399 New Beginnings Jonathan Walpole.
Real-time Software Design
CSCI1600: Embedded and Real Time Software
Lecture Topics: 11/1 General Operating System Concepts Processes
Threads and Concurrency
Real Time Java : Synchronization
CSCI1600: Embedded and Real Time Software
Chapter 2 Operating System Overview
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

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

Real-Time Java on JOP3 Real-Time Specification for Java Real-time extension definition Sun JSR - standard Still not completely finished Implementations Timesys RI Purdue OVM

Real-Time Java on JOP4 RTSJ Issues Large and complex specification Implementation Verification Scoped memory cumbersome Expensive longs (64 bit) for time values J2SE library Heap usage not documented OS functions can cause blocking

Real-Time Java on JOP5 RTSJ Subset Ravenscar Java Name from Ravenscar Ada Based in Puschner & Wellings paper Profile for high integrity applications RTSJ compatible No dynamic thread creation Only NHRTT Simplified scoped memory Implementation?

Real-Time Java on JOP6 Real-Time Profile Hard real-time profile See Puschner paper Easy to implement Low runtime overhead No RTSJ compatibility

Real-Time Java on JOP7 Real-Time Profile Schedulable objects Periodic activities Asynchronous sporadic activities Hardware interrupt or software event Bound to a thread Application Initialization Mission

Real-Time Java on JOP8 Application Structure Initialization phase Fixed number of threads Thread creation Shared objects in immortal memory Mission Runs forever Communication via shared objects Scoped memory for temporary data

Real-Time Java on JOP9 Schedulable Objects Three types: RtThread, HwEvent and SwEvent Fixed priority Period or minimum interarrival time Scoped memory per thread Dispatched after mission start public class RtThread { public RtThread(int priority, int period)... public RtThread(int priority, int period, int offset, Memory mem) public void enterMemory() public void exitMemory() public void run() public boolean waitForNextPeriod() public static void startMission() } public class HwEvent extends RtThread { public HwEvent(int priority, int minTime, Memory mem, int number) public void handle() } public class SwEvent extends RtThread { public SwEvent(int priority, int minTime, Memory mem) public final void fire() public void handle() }

Real-Time Java on JOP10 Scheduling Fixed priority with strict monotonic order Priority ceiling emulation protocol Top priority for unassigned objects Interrupts under scheduler control Priority for device drivers No additional blocking time Integration in schedulability analysis

Real-Time Java on JOP11 Memory No GC: Heap becomes immortal memory Scoped memory Bound to one thread at creation Constant allocation time Cleared on creation and on exit Simple enter/exit syntax

Real-Time Java on JOP12 Restrictions of Java Only WCET analyzable language constructs No static class initializer Use a static init() function No finalization Objects in immortal memory live forever Finalization complicates WCET analysis of exit from scoped memory No dynamic class loading

Real-Time Java on JOP13 Implementation Scheduler for a Java real-time profile Periodic and sporadic threads Preemptive Fixed priority Microcode Java

Real-Time Java on JOP14 Low-level Functions Access to JVM internals Exposed as special bytecodes In Java declared as native methods Translation Avoids non-standard class files

Real-Time Java on JOP15 Interrupts in JOP Translation of JVM bytecodes to microcode Interrupts are special bytecodes Inserted in the translation stage Call of JVM internal Java method

Real-Time Java on JOP16 Dispatching Scheduler is a Java method Context of task is on the stack Exchange stack Set stack pointer Simple return private static int newSp; public static void schedule() { Native.wr(0, IO_INT_ENA); RtThread th = tasks[active]; th.sp = Native.getSP(); Native.int2extMem(...); // find ready thread and // new timer value newSp = tasks[ready].sp; Native.int2extMem(...); Native.wr(tim, IO_TIMER); Native.setSP(newSp); Native.wr(1, IO_INT_ENA); }

Real-Time Java on JOP17 Implementation Results Scheduler and Dispatch in Java Only one function in microcode Test JVM in C JOP compatible JVM Implements timer with timestamp counter Scheduling in Java No OS needed, just a 32-bit C compiler

Real-Time Java on JOP18 User-Defined Scheduler Java is a safe OO Language No pointers Type-safety No kernel user space distinction Hooks for scheduling Scheduler in Java extended to a framework Class Scheduler Class Task

Real-Time Java on JOP19 Schedule Events Timer interrupt HW interrupt Monitor Thread blocking SW Event

Real-Time Java on JOP20 Interrupts Hook for HW interrupts Timer interrupt results in scheduler call Access to timer interrupt Generate interrupt for blocking SW Event is not part of the framework

Real-Time Java on JOP21 Synchronization Part of the language Each object can be a monitor JVM instruction or method declaration synchronized void foo() {... } synchronized(o) {... }

Real-Time Java on JOP22 Synchronization cont. Called by framework: monitorEnter(Object o) monitorExit(Object o) Attach user data to an object: attachData(Object obj, Object data) getAttachedData(Object obj)

Real-Time Java on JOP23 Services for the Scheduler Dispatch Time Timer Interrupts

Real-Time Java on JOP24 Class Scheduler Extended for a user-defined scheduler User provides: schedule() Monitor handling Framework supplies: Software interrupt for blocking Dispatch function Current time Timer interrupt

Real-Time Java on JOP25 Class Task Minimal (not j.l.Thread) Provides list of tasks Scoped memory Usually extended

Real-Time Java on JOP26 A Simple Example class Work extends Task { private int c; Work(int ch) { c = ch; } public void run() { for (;;) { Dbg.wr(c); // debug output int ts = Scheduler.getNow() ; while (ts-Scheduler.getNow()>0) ; }

Real-Time Java on JOP27 A Simple Example cont. public class RoundRobin extends Scheduler { public void schedule() { Task t = getRunningTask().getNext(); if (t==null) t = Task.getFirstTask(); dispatch(t, getNow()+10000); } public static void main(String[] args) { new Work(‚a'); new Work(‚b'); RoundRobin rr = new RoundRobin(); rr.start(); }

Real-Time Java on JOP29 Summary RTSJ is too complex System code in Java is possible No extra memory protection needed Dispatch is 20% slower in framework Missing C++ friend in Java JopVm in C

Real-Time Java on JOP30 Garbage Collection? An essential part of Java Without GC it is a different computing model RTSJ does not believe in real-time GC Real-time collectors evolve Active research area For You?

Real-Time Java on JOP31 Further Reading P. Puschner and A. J. Wellings. A Profile for High Integrity Real- Time Java Programs. In 4th IEEE International Symposium on Object-oriented Real-time distributed Computing (ISORC), M. Schoeberl, Design Rationale of a Processor Architecture for Predictable Real-Time Execution of Java Programs, In Proceedings of the 10th International Conference on Real-Time and Embedded Computing Systems and Applications (RTCSA), M. Schoeberl, Real-Time Scheduling on a Java Processor, In Proceedings of the 10th International Conference on Real-Time and Embedded Computing Systems and Applications (RTCSA), 2004.