CSCI1600: Embedded and Real Time Software Lecture 18: Real Time Languages Steven Reiss, Fall 2015.

Slides:



Advertisements
Similar presentations
Multimedia Network Communications Subject:T0934 / Multimedia Programming Foundation Session:13 Tahun:2009 Versi:1/0.
Advertisements

Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
J2ME 25 July Overview  What is J2ME?  The CLDC and CDC configurations  MIDP and MIDlets  Development Tools  Demonstrations.
Model for Supporting High Integrity and Fault Tolerance Brian Dobbing, Aonix Europe Ltd Chief Technical Consultant.
UNDERSTANDING JAVA APIS FOR MOBILE DEVICES v0.01.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 10 Java for MIDs Rob Pooley
Chapter 13 Embedded Systems
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
IBM Software Group © 2005 IBM Corporation Compilation Technology Toward Deterministic Java Performance Mark Stoodley, Mike Fulton Toronto Lab, IBM Canada.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
© Andy Wellings, 2004 Roadmap  Introduction  Concurrent Programming  Communication and Synchronization  Completing the Java Model  Overview of the.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Chapter 13 Embedded Systems
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
1/23/2008CSCI 315 Operating Systems Design1 Processes Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating.
CS884 (Prasad)Java Goals1 “Perfect Quote” You know you've achieved perfection in design, Not when you have nothing more to add, But when you have nothing.
SM3121 Software Technology Mark Green School of Creative Media.
Memory Management for Real-Time Java Wes Beebee and Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Supported by: DARPA.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
Embedded Java Research Geoffrey Beers Peter Jantz December 18, 2001.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 11 J2ME and MIDlets Rob Pooley
Advanced Operating Systems CIS 720 Lecture 1. Instructor Dr. Gurdip Singh – 234 Nichols Hall –
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.
Java 2 Micro Edition (J2ME) and the world of java
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.
Java Virtual Machine Case Study on the Design of JikesRVM.
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s.
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.
XOberon CS Fall 2002 Dr. Abzug Jeremy Bruker Jeremy Carbaugh Jeff Hensley Drew Stockdreher.
Reference: Ian Sommerville, Chap 15  Systems which monitor and control their environment.  Sometimes associated with hardware devices ◦ Sensors: Collect.
XOberon Operating System CLAUDIA MARIN CS 550 Fall 2005.
Writing Systems Software in a Functional Language An Experience Report Iavor Diatchki, Thomas Hallgren, Mark Jones, Rebekah Leslie, Andrew Tolmach.
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)
EEL Real-time Java part 2. EEL Acknowledgements All the lecture slides were adopted from the slides of Andy Wellings.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
CSCI1600: Embedded and Real Time Software Lecture 27: Real Time Linux Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
The Structuring of Systems Using Upcalls By David D. Clark Presented by Samuel Moffatt.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
Java Thread Programming
The Java Platform Micro Edition Java ME
Object Oriented Programming in
Context-related issues in real-time systems
Programming of Handheld and Mobile Devices
Microprocessor Systems Design I
Introduction to the CVM and the Timesys RI
Processes and Threads Processes and their scheduling
MOBILE DEVICE OPERATING SYSTEM
Lecture 1 Runtime environments.
Introduction Enosis Learning.
Real-time Software Design
Introduction Enosis Learning.
CSCI1600: Embedded and Real Time Software
Lecture Topics: 11/1 General Operating System Concepts Processes
Real Time Java : Synchronization
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Java History, Editions, Version Features
Lecture 1 Runtime environments.
CSCI1600: Embedded and Real Time Software
Presentation transcript:

CSCI1600: Embedded and Real Time Software Lecture 18: Real Time Languages Steven Reiss, Fall 2015

Programming Language Wars

Programming Languages  For real-time and embedded programming  Choices  Assembler  C/C++ (low-level language)  Java/C# (high-level language)  Data flow languages (FPGA)  Other  How should we choose?

Criteria for Choosing  Small footprint for embedded systems  Ability to write small code  Ability to make efficient use of memory  High performance  Predictable performance  Real time features  Interrupts  Scheduling tasks or threads  Synchronization

Criteria For Choosing  Low Power consumption  Other factors  Fault tolerance  Writing reliable code (verifiable, testable, understandable)  Writing secure code  Code understandability

C versus C++ versus Assembler  Footprint  Performance  Real time features (interrupts, synchronization, scheduling control)  Fault tolerance  Reliability  Security  Understandability

Why Not Java  What are the pros and cons?

What about Java  Not what Java was designed for  Potential problems  Java has the reputation of being slow & unpredictable  Java programs are large  Garbage collection and run time checks seem a bad idea  Interpreted languages are too slow

Reasons to Use Java  Don’t want to give up a language we are used to  Java programs are more reliable  Many errors caught at source/run time level  More secure  Safety is critical  Easier to verify  Exceptions, threads, synchronization built in  Data structures that are thread safe

Using Java  Two efforts under way  Address embedding issues  Address real time issues  Understanding these helps understanding  Embedded and real time programming in general

Embedded Java  Basic Problems  VM, JIT compiler, libraries are big (64M, 256M)  Scheduling abstraction used for threads is not fixed priority  Java emphasizes device independence  No access to physical memory (IO)  How can these problems be addressed?

Java ME and pJava  Attempts to address size & independence issues  Organized in terms of configurations  Configuration = broad range of similar devices  Determines what libraries to include  Determines JVM features to include  Scalable OS  Select the features needed for the application  Can run in 64k in smallest configuration  No verification, finalization, class loader, thread groups, reflection  Limited I/O, error handling  Limited data types (no 64 bit, no multidimensional arrays)

J2ME Configurations  Connected Devise Configuration  Limited set of library classes  32 bit, 4MB memory required  Most code sits in ROM  Connected Limited Device Configuration  Even more limited  512K memory required

J2ME Profiles  Support sets of similar devices  Mobile Information Device Profile  Touch screen or keypad, 96x54 or larger display  Wireless networking  Runs with 32k ram, 8k eeprom, 128k flash  Used in PDAs, mobile phones, pagers  Optional packages  Mobile Media API support multimedia applications  Other Embedded Javas  Java Card – applet on a smart card  Java TV – for set top boxes

Java Real Time  Embedding is easy  Just pare down the language and libraries  Real time requirements are more difficult  Affect the execution model of the language  Nothing in Java spec makes wall-clock guarantees  Garbage collection pauses do not affect the semantics  Thread priorities exist but aren’t well defined

Compiled Approach  Fiji VM  Precompile Java to C  OS includes the garbage collector  Overhead about 30% over straight C code  Max time of about 10% long  But this is experimental, not a guarantee

JSR1: Real Time Java Specification  Thread scheduling and dispatch (tasks)  Memory management  Synchronization and resource sharing  Asynchronous event handling  Asynchronous transfer of control  Asynchronous thread termination  Physical memory access

Thread Scheduling  Basic real-time scheduler is included  Priority based and preemptive  At least 28 priority level  Can define your own schedulers  Schedulable Objects  RealtimeThread :: uses real time scheduler  NoHeapRealtimeThread :: may not allocate or reference normal heap  Can run in preference to GC  GC can be preempted

Memory Management  Garbage collection is a problem  Not that it exists, but that it makes response time unpredictable  Why not just interrupt the garbage collector  Needs to lock all of memory?  Actually needs to lock all of garbage collected memory  Hence create memory areas that are separate

Memory Management  Memory Areas  Regions of memory outside of traditional Java heap  Don’t have to e garbage collected  Scoped Memory  For objects that have a lifetime defined by the scope  Physical memory  Specific regions for specific purposes  Immortal memory  Never collected  Budgeted allocation  Limit allocation for a schedulable objet  Can be preallocated

Synchronization  Problems  Synchronized data structures  Interactions with scheduling  Blocking times as part of max response time  Wait Queues as a primitive class  Dealing with priority problems  Priority inheritance supported  Priority ceiling emulation supported  Wait-free classes for non-blocking shared access  Fixed upper bound on entering an unlocked synchronized block

Asynchronous Event Handling  Bind handlers to internal and external events  External events  Signals, timers, interrupts (classes to support these)

Asynchronous Transfer of Control  Can you interrupt or stop a thread in Java?  What do Thread.interrupt() and Thread.stop() do?  Schedulable objects  Can declare throws AsynchronouslyInterruptedException  These can be safely interrupted  When interrupted, interruptAction() is invoked  Can stop a thread through implicit exceptions

Homework  For next week (10/26)  Present you project to the class  Plans, progress to date  Project model  Tasks and model(s) for each task  Hand this in  Can be part of presentation