SlideShare ist ein Scribd-Unternehmen logo
1 von 78
Towards
“write once – run wherever possible”
with Safety Critical Java
Bent Thomsen
InfinIT Højniveausprog sem19
18.06.2014
A typical safety critical embedded
hard-real-time program
Cruise control:
Loop every X microseconds
Read the sensors;
Compute speed;
if speed too high
Compute pressure for brake pedal;
if speed too low
Compute pressure for accelerator;
Transmit the outputs to actuators;
wait for next period;
How hard can it be to program such systems?
Aparently hard enough
• Toyota's Accelerator Problem Probably Caused
by Embedded Software Bugs
• Software Bug Causes Toyota Recall of Almost
Half a Million New Hybrid Cars
• BMW recall: The company will replace
defective high-pressure fuel pump and update
software in 150,000 vehicles.
Some examples
• The Ariane 5 satellite launcher malfunction
– caused by a faulty software exception routine
resulting from a bad 64-bit floating point to 16-bit
integer conversion
• LA Air Traffic control system shutdown (2004)
– Caused by count down timer reaching zero
• Airbus A330 nose-diving twice while at cruising
altitude (2001)
– 39 injured, 12 seriously. Problem never found
A hard real-time problem
Embedded Systems
• Over 90% of all microprocessors are used for real-
time and embedded systems
– Market growing 10% year on year
• Usually programmed in C or Assembler
– Hard, error prone, work
– But preferred choice
• Close to hardware
• No real alternatives
– Difficult to find new skilled programmers
• Jackson Structured Development (1975) still widely used
• EE Times calling for re-introducing C programming at US Uni
Well … ADA – 10th on the list of most wanted skills
Model Driven Development
• Develop Model of System
• Verify desirable properties
• Generate Code from Model
• But ..
– Many finds developing models harder than programming
– Often some parts have to be programmed anyhow
– Model and code have tendency to drift apart
We need to look for other languages
• The number of embedded systems is growing
• More functionality in each system is required
• More reliable systems are needed
• Time to market is getting shorter
• Increase productivity
– Software engineering practices (OOA&D) – 10%
– Tools (IDEs, analyzers and verifiers) – 10%
– New Languages -700%
• 200%-300% in embedded systems programming (Atego)
Java
• Most popular programming language ever !
– In 2005 Sun estimated 4.5 million Java
programmers
– In 2010 Oracle estimated 9 million Java
programmers
– 61% of all programmers are Java programmers
• Originally designed for setop-boxes
• But propelled to popularity by the internet
http://jaxenter.com/how-many-java-developers-are-there-10462.html
Advantage of Java over C and C++
• Clean syntax and (relative) clean semantics
• No preprocessor
• Wide range of tool support
• Single dispatch style OOP
• Strong, extendible type system
• Better support for separating subtyping and reuse via
interfaces and single inheritance
• No explicit pointer manipulation
• Pointer safe deallocation
• Built-in Concurrency model
• Portability via JVM (write once, run anywhere)
Embedded hard real-time
safety-critical systems
– Nuclear Power plants, car-control systems, aeroplanes etc.
– Embedded Systems
• Limited Processor power
• Limited memory
• Resources matter!
– Hard real-time systems
• Timeliness
– Safety-critical systems
• Functional correctness
– Mine Pump and Candy Sorting machine
– Grundfos pumps and SKOV pig farm air conditions
– Aalborg Industries (ship boilers) and Therma (aero, defence)
– GomSpace and NASA
But Java is not for Nuclear facilities!
3) RESTRICTIONS. Software is confidential and
copyrighted. Title to Software and all associated
intellectual property rights is retained by Sun
and/or its licensors. Unless enforcement is
prohibited by applicable law, you may not modify,
decompile, or reverse engineer Software. You
acknowledge that Licensed Software is not
designed or intended for use in the design,
construction, operation or maintenance of any
nuclear facility....
What is the problem with Java?
• Unpredictable performance
– Memory
• Garbage collected heap
– Control and data flow
• Dynamic class loading
• Recursion
• Unbounded loops
• Dynamic dispatch
• Exceptions
– Scheduling
– Lack high resolution time
• JVM
– Good for portability – bad for predicatbility
15
Observation
There is essentially only one way to get a more
predictable language:
• namely to select a set of features which makes
it controllable.
• Which implies that a set of features can be
deselected as well
Real-Time Java Profiles
• RTSJ (JSR 001)
– The Real-Time Specification for Java
– An attempt to cover everything
– too complex and dynamic
– Not suitable for high integrity systems
• Safety-Critical Java (draft) (JSR 302)
– Subset of RTSJ
– Focus on simplicity, analysability, and certification
– No garbage collection: Scoped memory
– Missions and Handlers (and some threads)
– Implementation: sub-classes of RTSJ
• Predictable Java
– Super classes for RTSJ
– Simple structure
– Inspiration for SCJ
Real-Time Specification for Java (RTSJ)
• Java Community Standard (JSR 1, JSR 282)
– Started in 1998
• January 2002 – RTSJ 1.0 Accepted by JSP
• Spring 2005 – RTSJ 1.0.1 released
• Summer 2006 – RTSJ 1.0.2 initiated
• March 2009 Early draft of RTSJ version 1.1 now called JSR 282.
• Most common for real-time Java applications
– Especially on Wall Street
• New Thread model: NoHeapRealtimeThread
– Never interrupted by Garbage Collector
– Threads may not access Heap Objects
– Extends Java’s 10 priority levels to 28
18
RTSJ Overview
• Clear definition of scheduler
• Priority inheritance protocol
• NoHeapRealtimeThread
• BoundAsyncEventHandler
• Scoped memory to avoid GC
• Low-level access through raw memory
• High resolution time and timer
• Originally targeted at larger systems
– implementation from Sun requires a dual
UltraSparc III or higher with 512 MB memory and
the Solaris 10 operating system
19
RTSJ Guiding Principles
• Backward compatibility to standard Java
• No Syntactic extension
• Write Once, Run Anywhere
• Reflected current real-time practice anno 1998
• Allow implementation flexibility
• Does not address certification of Safety Critical
applications
Safety-Critical Java (SCJ)
• Java Specification Request 302
• Aims for DO178B, Level A
• Three Compliance Points (Levels 0, 1, 2)
– Level 0 provides a cyclic executive (single thread), no
wait/notify
– Level 1 provides a single mission with multiple
schedulable objects,
– Level 2 provides nested missions with (limited) nested
scopes
• More worst case analysis friendly
• Restricted subset of RTSJ
SCJ
• Only RealtimeThreads are allowed
• Notions of missions and handlers
• No heap objects/ no GC
• Restricted use of scopes
Predictable Java (PJ)
• Predictable Java intended as guidance/ideas for SCJ
• JSR-302 uses inheritance for limitation
– Lots of @SCJAllowed annotations everywhere
• RTSJ would be a specialisation of a smaller profile
• PJ suggests to use inheritance for specialisation
– Generalisation of RTSJ
• Missions are first-class handlers
– Scoped memory belonging to the mission
• No need for immortal memory known from RTSJ and SCJ.
• Simplifies memory hierarchy
• Programs are more Java like
Many variants of Java
• J2EE
– J2SE & enterprise extensions
• J2SE
– Standard Java
• J2ME
– Subset of J2SE & additional
classes
• RTSJ
– Add on to J2EE, J2SE, or J2ME
for realtime
• SCJava
– Subset of RTSJ, subset of J2SE,
& additional classes
Predicatble JVM
• JOP
– Java Optimized Processor
– JVM in Hardware (FPGA)
• HVM
– targeted at devices with 256 kB flash and 8kB of RAM
– Interpreted or AOT compilering
– 1st level interupt handlers in Java
– Runs on ATmega2560, CR16C, ARM7, ARM9 and x86
• JamaicaVM
– Industrial strength real-time JVM from Aicas
– Enroute for Certification for use in Airplanes and Cars
Java look-and-feel for low-end embedded devices
Support incremental move from C to Java 25
The HVM
Java-to-C compiler with an embedded interpreter
26
Features
- Execution on the bare metal
- First level interrupt handling & Hardware Objects
- Hybrid execution style (interpretation + AOT)
- Program specialization
* Classes & methods
* Interpreter
- Native variable support
- Portability
* No external dependencies
* Strict ANSI-C
- Process switching & scoped memory
The Predictable Real-time HVM
• Time predictable implementations of
Interpreter loop and each bytecode
Trinity of tools, platform and
programming model
What about Time Analysis?
• Traditional approaches to
analysis of RT systems are hard
and conservative
• Very difficult to use with Java
because of JVM (and Object
Orientedness)
41
Utilisation-Based Analysis
• A simple sufficient but not necessary
schedulability test exists
)12( /1
1
 
N
N
i i
i
N
T
C
U
 NU as69.0
Where C is WCET and T is period
42
Response Time Equation
j
ihpj
j
i
ii
C
T
R
CR  






 )(
Where hp(i) is the set of tasks with priority higher than task i
Solve by forming a recurrence relationship:
j
ihpj
j
n
i
i
n
i
C
T
w
Cw  








)(
1
The set of values is monotonically non decreasing
When the solution to the equation has been found,
must not be greater that (e.g. 0 or )
1
 n
i
n
i ww
,..,...,,, 210 n
iiii wwww
0
iw
iR iC
Model based Analysis
– TIMES
• Model based schedulability tool based on UPPAAL
– WCA
• WCET analysis for JOP
– SARTS
• Schedulability on JOP
– TetaJ
• WCET analysis for SW JVM on Commodity HW
– TetaSARTS
• Schedulability analysis for SW JVM on Commodity HW and JOP
– SymRT
• Combines Symbolic executioon and modelbased timing analysis
30
31
SARTS
• Schedulability analyzer for real-time Java systems
– Assumes program in SCJ profile
– Assumes correct Loop bounds annotations
– Assumes code to be executed on JOP
• Generates Timed Automata
– Control flow graph with timing information
– Uppaal Model-checker checks for deadlock
– Based on ideas from TIMES tool
SARTS Overview
32
SARTS Overview
• A scheduler automaton models FPS
• A controller automaton, periodic/sporadic, is
created for each handler
• Each Java method results in a parametrised
automaton
– One clock per task/thread
– Pre-emption is modelled using stopwatches
– Control-transfer is modelled using synchronization
33
34
Java to UPPAAL
35
Timed Automata templates
• Translation of Basic
Blocks into states and
transitions
• Patterns for:
– Loops
– Monitor statements
– If statements
– Method invoke
– Sporadic task release
36
Simple models of RM scheduler
• Predefined models
– Scheduler
– Periodic Task
– Sporadic Task
37
Periodic Task/Sporadic Task
SARTS sales pitch
• The schedulability question is “translated" to a
deadlock question
– no deadlock means schedulable
• Compared to traditional schedulability analysis
– Control flow sensitive
– Fine grained interleaving
– Less pessimism
– Fully automatic
38
39
SARTS can do better than utilisation test
• Example
• One periodic task
• Two sporadic tasks
– Mutually exclusive
40
SARTS can do better than utilisation test
• Period: 240
• Minimum inter-arrival time: 240
• Periodic cost: 161
• Sporadic cost: 64
• Utilisation test fails:
41
Time Line
TetaJ
• WCET analysis tool
– taking Java portability into account
• Analysis at method level
• Can be used interactively
• Takes VM into account
• Takes HW into account
42
43
44
TetaSARTS
45
Minepump example
46
Minepump example
Write once – run whereever possible
47
Energy Optimize Applications
SymRT
• Combining Symbolic execution and TA
Compositional Verification
• TetaSARTS generates model for whole program
• Library routines analysed again and again
• Models based on control flow can be complicated
• Idea: Annotate interfaces with abstract
description of behaviour
– Time and Resource Specification Language (TRSL)
– Could have been any of a range of spec. lang.
• UML/Marte, ACSR, TADL
50
Note – could have used [ 1..8 ; using(r)[2] ; 1 ] since
[ 1 ; 7? ; using(r)[2] ; 1 ] ≤ [ 1 ..8 ; using(r)[2] ; 1 ]
TetaSARTS+
• Schedulability analysis now in three steps
– Verify that implementation is simulated by
specification
• Check L(Implementation) ≤ L(specification)
• Possible since TRSL TAs are simple instances of the
Event-Clock Automata
– Generate TAs from Specs
– Use TetaSARTS
Further Analysis and tools
• Scope compliance analysis for SCJ
• SCJ compliance analyzer
• Eclipse plug-in
• Lot’s of work on (analyzable) Real-time GC
Future Work
• Experiment with deductive verification
– Functional requirements
– JML and Key
– Especially loop bounds
• Termination Analysis
– Recursion bounds
• Hierarchical schedulability (mixed mode)
• Analyse non-SCJ programs
– Java 8, Groovy, Scala
• Multi-core HVM
• Android and Dalvik VM
• Loadable Safelets and cloud verification
Future Work
• Internet of Things
– We can do it today, but how to do it fast and reliable?
– aicas's JamaicaVM hard real-time Java-based
platform to provide a secure, scalable solution
connecting intelligent devices to cloud-based
services.
– Some of my ideas:
– Combining work on SCJ with
• SmartCampus
• HomePort 55
Learn more
• Model-based schedulability analysis of safety critical hard real-time
java programs
– T. Bøgholm, H. Kragh-Hansen, P. Olsen, B. Thomsen, and K. G. Larsen
– JTRES 2008
• Schedulability Analysis Abstractions for Safety Critical Java
– Thomas Bøgholm, Bent Thomsen, Kim G. Larsen, Alan Mycroft
– ISORC 2012
• Wcet analysis of java bytecode featuring common execution
environments
– C. Frost, C. S. Jensen, K. S. Luckow, and B. Thomsen
– JTRES 2011
• TetaSARTS: A Tool for Modular Timing Analysis of Safety Critical
Java Systems
– Kasper Luckow, Thomas Bøgholm, Bent Thomsen, and Kim Larsen
– To appear JTRES 2013
56
Try it out?
• TetaSARTS
– http://people.cs.aau.dk/~luckow/tetasarts/
• Hardware Near Virtual Machine
– http://icelab.dk/
• oSCJ (open Safety-Critical Java Implementation)
– http://sss.cs.purdue.edu/projects/oscj/
• Java Optimized Processor
– http://www.jopdesign.com/
• JamaicaVM
– http://www.aicas.com/jamaica.html 57
58
Joint work with:
• Allan Mycroft
– Cambridge University
• Corina S. Pasareanu
– NASA Ames, CA, USA
• Hans Søndergaard, Stephan Korsholm
– Via University College
• Thomas Bøgholm, Kasper Søe Luckow, Anders P. Ravn,
Kim G. Larsen, Rene R. Hansen and Lone Leth
Thomsen
– CISS/Department of Computer Science, Aalborg University
Thank You
59
60
SmartCampusAAU project
• Motivation:
• An essential part of the strategy for future growth in the North Jutland region of Denmark
(Region Nordjylland- RN) is centred around private companies, as well as public services,
use of location and other contextual information in Intelligent solutions.
• RN already sponsor several clusters of projects: SmartCityDK, Intelligent Transport and
Infotainment
• Observation:
– All such projects build (throwaway) middleware needed for their demonstrations
• Goal:
– Build scalable and re-usable middleware infrastructure enabling easy development of location
based applications
• Project Period: 3.8.2009 – 31.12.2011 (funded by RN / EU regional development)
• SmartCampus2.0: 1.1.2012-31.12.2012 (funded by CaIN)
• SmartCampus3.0: 1.3.2013 – 30.6.2013 (funded by InfinIT)
61
WiFi-based localization
• RADAR (by Microsoft Research in 2000)
• (almost) No need for new infrastructure
• Fingerprinting
62
Location Fingerprinting
- The Offline Phase
AP1
AP3
AP3
AP1 = -40
AP2 = -70
AP3 = -95
(x1, y1, z1)
AP1 = -45
AP2 = -60
AP3 = -85
AP1 = -65
AP2 = -55
AP3 = -75
AP1 = -80
AP2 = -45
AP3 = -60
(x2, y2, z1)
…
(x3, y3, z1)
(x4, y4, z1)
(…)
Radio Map
63
Location Fingerprinting
- The Online Phase
AP1
AP3
AP2
AP1 = -55
AP2 = -40
AP3 = -80
(x1, y1, z1)
AP1 = -40
AP2 = -60
AP3 = -95
AP1 = -40
AP2 = -70
AP3 = -85
AP1 = -35
AP2 = -90
AP3 = -55
(x2, y2, z1)
…
(x3, y3, z1)
(x4, y4, z1)
(…)
Radio Map
AP1 = -50
AP2 = -40
AP3 = -85
Improving WLAN Positioning with
Weighted Graphs
Indoor Navigation
65
IFC file PIFC file
•Standard format
•Big file, used only on PC
•Can be read using
specialized toolkit
•Unaligned to real word
•Non-standard XML-based
format
•Small file, can be used on
pocket PC
•Extendable for different types of
objects
•Can be read using XML parser
•Aligned to WGS84
Foreach (building, storey) extract:
Walls, spaces, access points …
Conversion on user machine or
Streamspin service
Infrastructure-Based Positioning
• iPhone and WP 7 does not support device-based positioning.
• Instead, a ”Wi-Fi sniffer” infrastructure is required.
• Positioning is done on Infrastructure-Based Positioning Service
67
Building the radio maps
• Two types of radio maps:
1. Device-based radio map
– Measurement done locally and uploaded.
2. Infrastructure-based radio map
• The Android app builds both radio maps in one go.
68
1.A) bool StartMeasuringAtBoundLocation(
string clientMac, int buildingId, int vertexId)
1.B) bool StartMeasuringAtUnboundLocation(
string clientMac, int buildingId, int latE6, int lonE6, int alt)
2) bool StopMeasuring(string clientMac)
3) int SaveMeasurement(string clientMac)
Setting up a Wi-Fi sniffer infrastructure
• Buy appropriate equipment or use/ modify existing (
http://wiki.openwrt.org/toh/start )
• Update firmware (contact us for instructions)
• Start sniffing!
• I.e., start sending measurement reports of the form [sniffer_mac,
time, RSSI, client_mac] to our Infrastructure-Based Positioning
Service.
• Contact us regarding hosting of infrastructure-based pos. service:
– Use smartcampus server
– Use your own server
– Use an intermediary to filter measurement reports
69
3rd Positioning Service
• Infrastructure-Based, Device-Assisted Positioning
• For positioning and tracking of IoT devices
70
* RTX41xx: http://www.rtx.dk/RTX4100_Wi-Fi_module-3921.aspx
Integration
• PIM (Calandar)
http://way.askcody.dk/d.php?id=1644
• Intelligent signs
• Social Networks
• Intelligent Buildings
72
Interacting with smart buildings
HomePort
Door locks
Conlan Demo
• Objective: Turn on Conlan device when mobile
device is within 10 meters
73
Solution from MapsPeople
• Geo Location Manager
Location-Based Edutainment
(group SW805 and Mymo®)
78

Weitere ähnliche Inhalte

Was ist angesagt?

Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsIsuru Perera
 
Java Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep DiveJava Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep DiveMarcus Hirt
 
Using Java Mission Control & Java Flight Recorder
Using Java Mission Control & Java Flight RecorderUsing Java Mission Control & Java Flight Recorder
Using Java Mission Control & Java Flight RecorderIsuru Perera
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Web Sphere Problem Determination Ext
Web Sphere Problem Determination ExtWeb Sphere Problem Determination Ext
Web Sphere Problem Determination ExtRohit Kelapure
 
Using Java Flight Recorder
Using Java Flight RecorderUsing Java Flight Recorder
Using Java Flight RecorderMarcus Hirt
 
Java mission control and java flight recorder
Java mission control and java flight recorderJava mission control and java flight recorder
Java mission control and java flight recorderWolfgang Weigend
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013Vladimir Ivanov
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & ProfilingIsuru Perera
 
Using Flame Graphs
Using Flame GraphsUsing Flame Graphs
Using Flame GraphsIsuru Perera
 
IBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkIBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkAdamRobertsIBM
 
HotSpot JVM Tuning
HotSpot JVM TuningHotSpot JVM Tuning
HotSpot JVM TuningGilad Garon
 
Getting Started with JDK Mission Control
Getting Started with JDK Mission ControlGetting Started with JDK Mission Control
Getting Started with JDK Mission ControlMarcus Hirt
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvmPrem Kuppumani
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection TuningKai Koenig
 
Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Roger Brinkley
 
WALT vs PELT : Redux - SFO17-307
WALT vs PELT : Redux  - SFO17-307WALT vs PELT : Redux  - SFO17-307
WALT vs PELT : Redux - SFO17-307Linaro
 

Was ist angesagt? (20)

Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Java Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep DiveJava Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep Dive
 
Using Java Mission Control & Java Flight Recorder
Using Java Mission Control & Java Flight RecorderUsing Java Mission Control & Java Flight Recorder
Using Java Mission Control & Java Flight Recorder
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Web Sphere Problem Determination Ext
Web Sphere Problem Determination ExtWeb Sphere Problem Determination Ext
Web Sphere Problem Determination Ext
 
Using Java Flight Recorder
Using Java Flight RecorderUsing Java Flight Recorder
Using Java Flight Recorder
 
Java mission control and java flight recorder
Java mission control and java flight recorderJava mission control and java flight recorder
Java mission control and java flight recorder
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
Using Flame Graphs
Using Flame GraphsUsing Flame Graphs
Using Flame Graphs
 
IBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkIBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache Spark
 
HotSpot JVM Tuning
HotSpot JVM TuningHotSpot JVM Tuning
HotSpot JVM Tuning
 
Getting Started with JDK Mission Control
Getting Started with JDK Mission ControlGetting Started with JDK Mission Control
Getting Started with JDK Mission Control
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
JVM and Garbage Collection Tuning
JVM and Garbage Collection TuningJVM and Garbage Collection Tuning
JVM and Garbage Collection Tuning
 
Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40
 
WALT vs PELT : Redux - SFO17-307
WALT vs PELT : Redux  - SFO17-307WALT vs PELT : Redux  - SFO17-307
WALT vs PELT : Redux - SFO17-307
 

Ähnlich wie Towards "write once - run whenever possible" with Safety Critical Java af Bent Thomsen, AAU

Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesBruno Borges
 
Real-time Programming in Java
Real-time Programming in JavaReal-time Programming in Java
Real-time Programming in JavaAleš Plšek
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVMAlex Birch
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfRichHagarty
 
Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014Lari Hotari
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningjClarity
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications OpenEBS
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...Edge AI and Vision Alliance
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnosticsDanijel Mitar
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community
 
Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!Monica Beckwith
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptxPratik Gohel
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLArnab Biswas
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Toronto-Oracle-Users-Group
 
Update on Trinity System Procurement and Plans
Update on Trinity System Procurement and PlansUpdate on Trinity System Procurement and Plans
Update on Trinity System Procurement and Plansinside-BigData.com
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019graemerocher
 

Ähnlich wie Towards "write once - run whenever possible" with Safety Critical Java af Bent Thomsen, AAU (20)

Værktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmerVærktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmer
 
Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
Real-time Programming in Java
Real-time Programming in JavaReal-time Programming in Java
Real-time Programming in Java
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
 
Java-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdfJava-light-speed NebraskaCode.pdf
Java-light-speed NebraskaCode.pdf
 
Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014Performance tuning Grails Applications GR8Conf US 2014
Performance tuning Grails Applications GR8Conf US 2014
 
Fastest Servlets in the West
Fastest Servlets in the WestFastest Servlets in the West
Fastest Servlets in the West
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
 
Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications Latest (storage IO) patterns for cloud-native applications
Latest (storage IO) patterns for cloud-native applications
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnostics
 
Introduction to multicore .ppt
Introduction to multicore .pptIntroduction to multicore .ppt
Introduction to multicore .ppt
 
Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph Ceph Community Talk on High-Performance Solid Sate Ceph
Ceph Community Talk on High-Performance Solid Sate Ceph
 
Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!Enabling Java: Windows on Arm64 - A Success Story!
Enabling Java: Windows on Arm64 - A Success Story!
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
 
Update on Trinity System Procurement and Plans
Update on Trinity System Procurement and PlansUpdate on Trinity System Procurement and Plans
Update on Trinity System Procurement and Plans
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 

Mehr von InfinIT - Innovationsnetværket for it

Mehr von InfinIT - Innovationsnetværket for it (20)

Erfaringer med-c kurt-noermark
Erfaringer med-c kurt-noermarkErfaringer med-c kurt-noermark
Erfaringer med-c kurt-noermark
 
Object orientering, test driven development og c
Object orientering, test driven development og cObject orientering, test driven development og c
Object orientering, test driven development og c
 
Embedded softwaredevelopment hcs
Embedded softwaredevelopment hcsEmbedded softwaredevelopment hcs
Embedded softwaredevelopment hcs
 
C og c++-jens lund jensen
C og c++-jens lund jensenC og c++-jens lund jensen
C og c++-jens lund jensen
 
201811xx foredrag c_cpp
201811xx foredrag c_cpp201811xx foredrag c_cpp
201811xx foredrag c_cpp
 
C som-programmeringssprog-bt
C som-programmeringssprog-btC som-programmeringssprog-bt
C som-programmeringssprog-bt
 
Infinit seminar 060918
Infinit seminar 060918Infinit seminar 060918
Infinit seminar 060918
 
DCR solutions
DCR solutionsDCR solutions
DCR solutions
 
Not your grandfathers BPM
Not your grandfathers BPMNot your grandfathers BPM
Not your grandfathers BPM
 
Kmd workzone - an evolutionary approach to revolution
Kmd workzone - an evolutionary approach to revolutionKmd workzone - an evolutionary approach to revolution
Kmd workzone - an evolutionary approach to revolution
 
EcoKnow - oplæg
EcoKnow - oplægEcoKnow - oplæg
EcoKnow - oplæg
 
Martin Wickins Chatbots i fronten
Martin Wickins Chatbots i frontenMartin Wickins Chatbots i fronten
Martin Wickins Chatbots i fronten
 
Marie Fenger ai kundeservice
Marie Fenger ai kundeserviceMarie Fenger ai kundeservice
Marie Fenger ai kundeservice
 
Mads Kaysen SupWiz
Mads Kaysen SupWizMads Kaysen SupWiz
Mads Kaysen SupWiz
 
Leif Howalt NNIT Service Support Center
Leif Howalt NNIT Service Support CenterLeif Howalt NNIT Service Support Center
Leif Howalt NNIT Service Support Center
 
Jan Neerbek NLP og Chatbots
Jan Neerbek NLP og ChatbotsJan Neerbek NLP og Chatbots
Jan Neerbek NLP og Chatbots
 
Anders Soegaard NLP for Customer Support
Anders Soegaard NLP for Customer SupportAnders Soegaard NLP for Customer Support
Anders Soegaard NLP for Customer Support
 
Stephen Alstrup infinit august 2018
Stephen Alstrup infinit august 2018Stephen Alstrup infinit august 2018
Stephen Alstrup infinit august 2018
 
Innovation og værdiskabelse i it-projekter
Innovation og værdiskabelse i it-projekterInnovation og værdiskabelse i it-projekter
Innovation og værdiskabelse i it-projekter
 
Rokoko infin it presentation
Rokoko infin it presentation Rokoko infin it presentation
Rokoko infin it presentation
 

Kürzlich hochgeladen

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Kürzlich hochgeladen (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Towards "write once - run whenever possible" with Safety Critical Java af Bent Thomsen, AAU

  • 1. Towards “write once – run wherever possible” with Safety Critical Java Bent Thomsen InfinIT Højniveausprog sem19 18.06.2014
  • 2. A typical safety critical embedded hard-real-time program Cruise control: Loop every X microseconds Read the sensors; Compute speed; if speed too high Compute pressure for brake pedal; if speed too low Compute pressure for accelerator; Transmit the outputs to actuators; wait for next period; How hard can it be to program such systems?
  • 3. Aparently hard enough • Toyota's Accelerator Problem Probably Caused by Embedded Software Bugs • Software Bug Causes Toyota Recall of Almost Half a Million New Hybrid Cars • BMW recall: The company will replace defective high-pressure fuel pump and update software in 150,000 vehicles.
  • 4. Some examples • The Ariane 5 satellite launcher malfunction – caused by a faulty software exception routine resulting from a bad 64-bit floating point to 16-bit integer conversion • LA Air Traffic control system shutdown (2004) – Caused by count down timer reaching zero • Airbus A330 nose-diving twice while at cruising altitude (2001) – 39 injured, 12 seriously. Problem never found
  • 6. Embedded Systems • Over 90% of all microprocessors are used for real- time and embedded systems – Market growing 10% year on year • Usually programmed in C or Assembler – Hard, error prone, work – But preferred choice • Close to hardware • No real alternatives – Difficult to find new skilled programmers • Jackson Structured Development (1975) still widely used • EE Times calling for re-introducing C programming at US Uni Well … ADA – 10th on the list of most wanted skills
  • 7. Model Driven Development • Develop Model of System • Verify desirable properties • Generate Code from Model • But .. – Many finds developing models harder than programming – Often some parts have to be programmed anyhow – Model and code have tendency to drift apart
  • 8. We need to look for other languages • The number of embedded systems is growing • More functionality in each system is required • More reliable systems are needed • Time to market is getting shorter • Increase productivity – Software engineering practices (OOA&D) – 10% – Tools (IDEs, analyzers and verifiers) – 10% – New Languages -700% • 200%-300% in embedded systems programming (Atego)
  • 9. Java • Most popular programming language ever ! – In 2005 Sun estimated 4.5 million Java programmers – In 2010 Oracle estimated 9 million Java programmers – 61% of all programmers are Java programmers • Originally designed for setop-boxes • But propelled to popularity by the internet http://jaxenter.com/how-many-java-developers-are-there-10462.html
  • 10.
  • 11. Advantage of Java over C and C++ • Clean syntax and (relative) clean semantics • No preprocessor • Wide range of tool support • Single dispatch style OOP • Strong, extendible type system • Better support for separating subtyping and reuse via interfaces and single inheritance • No explicit pointer manipulation • Pointer safe deallocation • Built-in Concurrency model • Portability via JVM (write once, run anywhere)
  • 12. Embedded hard real-time safety-critical systems – Nuclear Power plants, car-control systems, aeroplanes etc. – Embedded Systems • Limited Processor power • Limited memory • Resources matter! – Hard real-time systems • Timeliness – Safety-critical systems • Functional correctness – Mine Pump and Candy Sorting machine – Grundfos pumps and SKOV pig farm air conditions – Aalborg Industries (ship boilers) and Therma (aero, defence) – GomSpace and NASA
  • 13. But Java is not for Nuclear facilities! 3) RESTRICTIONS. Software is confidential and copyrighted. Title to Software and all associated intellectual property rights is retained by Sun and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. You acknowledge that Licensed Software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility....
  • 14. What is the problem with Java? • Unpredictable performance – Memory • Garbage collected heap – Control and data flow • Dynamic class loading • Recursion • Unbounded loops • Dynamic dispatch • Exceptions – Scheduling – Lack high resolution time • JVM – Good for portability – bad for predicatbility
  • 15. 15 Observation There is essentially only one way to get a more predictable language: • namely to select a set of features which makes it controllable. • Which implies that a set of features can be deselected as well
  • 16. Real-Time Java Profiles • RTSJ (JSR 001) – The Real-Time Specification for Java – An attempt to cover everything – too complex and dynamic – Not suitable for high integrity systems • Safety-Critical Java (draft) (JSR 302) – Subset of RTSJ – Focus on simplicity, analysability, and certification – No garbage collection: Scoped memory – Missions and Handlers (and some threads) – Implementation: sub-classes of RTSJ • Predictable Java – Super classes for RTSJ – Simple structure – Inspiration for SCJ
  • 17. Real-Time Specification for Java (RTSJ) • Java Community Standard (JSR 1, JSR 282) – Started in 1998 • January 2002 – RTSJ 1.0 Accepted by JSP • Spring 2005 – RTSJ 1.0.1 released • Summer 2006 – RTSJ 1.0.2 initiated • March 2009 Early draft of RTSJ version 1.1 now called JSR 282. • Most common for real-time Java applications – Especially on Wall Street • New Thread model: NoHeapRealtimeThread – Never interrupted by Garbage Collector – Threads may not access Heap Objects – Extends Java’s 10 priority levels to 28
  • 18. 18 RTSJ Overview • Clear definition of scheduler • Priority inheritance protocol • NoHeapRealtimeThread • BoundAsyncEventHandler • Scoped memory to avoid GC • Low-level access through raw memory • High resolution time and timer • Originally targeted at larger systems – implementation from Sun requires a dual UltraSparc III or higher with 512 MB memory and the Solaris 10 operating system
  • 19. 19 RTSJ Guiding Principles • Backward compatibility to standard Java • No Syntactic extension • Write Once, Run Anywhere • Reflected current real-time practice anno 1998 • Allow implementation flexibility • Does not address certification of Safety Critical applications
  • 20. Safety-Critical Java (SCJ) • Java Specification Request 302 • Aims for DO178B, Level A • Three Compliance Points (Levels 0, 1, 2) – Level 0 provides a cyclic executive (single thread), no wait/notify – Level 1 provides a single mission with multiple schedulable objects, – Level 2 provides nested missions with (limited) nested scopes • More worst case analysis friendly • Restricted subset of RTSJ
  • 21. SCJ • Only RealtimeThreads are allowed • Notions of missions and handlers • No heap objects/ no GC • Restricted use of scopes
  • 22. Predictable Java (PJ) • Predictable Java intended as guidance/ideas for SCJ • JSR-302 uses inheritance for limitation – Lots of @SCJAllowed annotations everywhere • RTSJ would be a specialisation of a smaller profile • PJ suggests to use inheritance for specialisation – Generalisation of RTSJ • Missions are first-class handlers – Scoped memory belonging to the mission • No need for immortal memory known from RTSJ and SCJ. • Simplifies memory hierarchy • Programs are more Java like
  • 23. Many variants of Java • J2EE – J2SE & enterprise extensions • J2SE – Standard Java • J2ME – Subset of J2SE & additional classes • RTSJ – Add on to J2EE, J2SE, or J2ME for realtime • SCJava – Subset of RTSJ, subset of J2SE, & additional classes
  • 24. Predicatble JVM • JOP – Java Optimized Processor – JVM in Hardware (FPGA) • HVM – targeted at devices with 256 kB flash and 8kB of RAM – Interpreted or AOT compilering – 1st level interupt handlers in Java – Runs on ATmega2560, CR16C, ARM7, ARM9 and x86 • JamaicaVM – Industrial strength real-time JVM from Aicas – Enroute for Certification for use in Airplanes and Cars
  • 25. Java look-and-feel for low-end embedded devices Support incremental move from C to Java 25 The HVM Java-to-C compiler with an embedded interpreter
  • 26. 26 Features - Execution on the bare metal - First level interrupt handling & Hardware Objects - Hybrid execution style (interpretation + AOT) - Program specialization * Classes & methods * Interpreter - Native variable support - Portability * No external dependencies * Strict ANSI-C - Process switching & scoped memory
  • 27. The Predictable Real-time HVM • Time predictable implementations of Interpreter loop and each bytecode
  • 28. Trinity of tools, platform and programming model
  • 29. What about Time Analysis? • Traditional approaches to analysis of RT systems are hard and conservative • Very difficult to use with Java because of JVM (and Object Orientedness) 41 Utilisation-Based Analysis • A simple sufficient but not necessary schedulability test exists )12( /1 1   N N i i i N T C U  NU as69.0 Where C is WCET and T is period 42 Response Time Equation j ihpj j i ii C T R CR          )( Where hp(i) is the set of tasks with priority higher than task i Solve by forming a recurrence relationship: j ihpj j n i i n i C T w Cw           )( 1 The set of values is monotonically non decreasing When the solution to the equation has been found, must not be greater that (e.g. 0 or ) 1  n i n i ww ,..,...,,, 210 n iiii wwww 0 iw iR iC
  • 30. Model based Analysis – TIMES • Model based schedulability tool based on UPPAAL – WCA • WCET analysis for JOP – SARTS • Schedulability on JOP – TetaJ • WCET analysis for SW JVM on Commodity HW – TetaSARTS • Schedulability analysis for SW JVM on Commodity HW and JOP – SymRT • Combines Symbolic executioon and modelbased timing analysis 30
  • 31. 31 SARTS • Schedulability analyzer for real-time Java systems – Assumes program in SCJ profile – Assumes correct Loop bounds annotations – Assumes code to be executed on JOP • Generates Timed Automata – Control flow graph with timing information – Uppaal Model-checker checks for deadlock – Based on ideas from TIMES tool
  • 33. SARTS Overview • A scheduler automaton models FPS • A controller automaton, periodic/sporadic, is created for each handler • Each Java method results in a parametrised automaton – One clock per task/thread – Pre-emption is modelled using stopwatches – Control-transfer is modelled using synchronization 33
  • 35. 35 Timed Automata templates • Translation of Basic Blocks into states and transitions • Patterns for: – Loops – Monitor statements – If statements – Method invoke – Sporadic task release
  • 36. 36 Simple models of RM scheduler • Predefined models – Scheduler – Periodic Task – Sporadic Task
  • 38. SARTS sales pitch • The schedulability question is “translated" to a deadlock question – no deadlock means schedulable • Compared to traditional schedulability analysis – Control flow sensitive – Fine grained interleaving – Less pessimism – Fully automatic 38
  • 39. 39 SARTS can do better than utilisation test • Example • One periodic task • Two sporadic tasks – Mutually exclusive
  • 40. 40 SARTS can do better than utilisation test • Period: 240 • Minimum inter-arrival time: 240 • Periodic cost: 161 • Sporadic cost: 64 • Utilisation test fails:
  • 42. TetaJ • WCET analysis tool – taking Java portability into account • Analysis at method level • Can be used interactively • Takes VM into account • Takes HW into account 42
  • 43. 43
  • 44. 44
  • 47. Minepump example Write once – run whereever possible 47
  • 49. SymRT • Combining Symbolic execution and TA
  • 50. Compositional Verification • TetaSARTS generates model for whole program • Library routines analysed again and again • Models based on control flow can be complicated • Idea: Annotate interfaces with abstract description of behaviour – Time and Resource Specification Language (TRSL) – Could have been any of a range of spec. lang. • UML/Marte, ACSR, TADL 50
  • 51. Note – could have used [ 1..8 ; using(r)[2] ; 1 ] since [ 1 ; 7? ; using(r)[2] ; 1 ] ≤ [ 1 ..8 ; using(r)[2] ; 1 ]
  • 52. TetaSARTS+ • Schedulability analysis now in three steps – Verify that implementation is simulated by specification • Check L(Implementation) ≤ L(specification) • Possible since TRSL TAs are simple instances of the Event-Clock Automata – Generate TAs from Specs – Use TetaSARTS
  • 53. Further Analysis and tools • Scope compliance analysis for SCJ • SCJ compliance analyzer • Eclipse plug-in • Lot’s of work on (analyzable) Real-time GC
  • 54. Future Work • Experiment with deductive verification – Functional requirements – JML and Key – Especially loop bounds • Termination Analysis – Recursion bounds • Hierarchical schedulability (mixed mode) • Analyse non-SCJ programs – Java 8, Groovy, Scala • Multi-core HVM • Android and Dalvik VM • Loadable Safelets and cloud verification
  • 55. Future Work • Internet of Things – We can do it today, but how to do it fast and reliable? – aicas's JamaicaVM hard real-time Java-based platform to provide a secure, scalable solution connecting intelligent devices to cloud-based services. – Some of my ideas: – Combining work on SCJ with • SmartCampus • HomePort 55
  • 56. Learn more • Model-based schedulability analysis of safety critical hard real-time java programs – T. Bøgholm, H. Kragh-Hansen, P. Olsen, B. Thomsen, and K. G. Larsen – JTRES 2008 • Schedulability Analysis Abstractions for Safety Critical Java – Thomas Bøgholm, Bent Thomsen, Kim G. Larsen, Alan Mycroft – ISORC 2012 • Wcet analysis of java bytecode featuring common execution environments – C. Frost, C. S. Jensen, K. S. Luckow, and B. Thomsen – JTRES 2011 • TetaSARTS: A Tool for Modular Timing Analysis of Safety Critical Java Systems – Kasper Luckow, Thomas Bøgholm, Bent Thomsen, and Kim Larsen – To appear JTRES 2013 56
  • 57. Try it out? • TetaSARTS – http://people.cs.aau.dk/~luckow/tetasarts/ • Hardware Near Virtual Machine – http://icelab.dk/ • oSCJ (open Safety-Critical Java Implementation) – http://sss.cs.purdue.edu/projects/oscj/ • Java Optimized Processor – http://www.jopdesign.com/ • JamaicaVM – http://www.aicas.com/jamaica.html 57
  • 58. 58 Joint work with: • Allan Mycroft – Cambridge University • Corina S. Pasareanu – NASA Ames, CA, USA • Hans Søndergaard, Stephan Korsholm – Via University College • Thomas Bøgholm, Kasper Søe Luckow, Anders P. Ravn, Kim G. Larsen, Rene R. Hansen and Lone Leth Thomsen – CISS/Department of Computer Science, Aalborg University
  • 60. 60 SmartCampusAAU project • Motivation: • An essential part of the strategy for future growth in the North Jutland region of Denmark (Region Nordjylland- RN) is centred around private companies, as well as public services, use of location and other contextual information in Intelligent solutions. • RN already sponsor several clusters of projects: SmartCityDK, Intelligent Transport and Infotainment • Observation: – All such projects build (throwaway) middleware needed for their demonstrations • Goal: – Build scalable and re-usable middleware infrastructure enabling easy development of location based applications • Project Period: 3.8.2009 – 31.12.2011 (funded by RN / EU regional development) • SmartCampus2.0: 1.1.2012-31.12.2012 (funded by CaIN) • SmartCampus3.0: 1.3.2013 – 30.6.2013 (funded by InfinIT)
  • 61. 61 WiFi-based localization • RADAR (by Microsoft Research in 2000) • (almost) No need for new infrastructure • Fingerprinting
  • 62. 62 Location Fingerprinting - The Offline Phase AP1 AP3 AP3 AP1 = -40 AP2 = -70 AP3 = -95 (x1, y1, z1) AP1 = -45 AP2 = -60 AP3 = -85 AP1 = -65 AP2 = -55 AP3 = -75 AP1 = -80 AP2 = -45 AP3 = -60 (x2, y2, z1) … (x3, y3, z1) (x4, y4, z1) (…) Radio Map
  • 63. 63 Location Fingerprinting - The Online Phase AP1 AP3 AP2 AP1 = -55 AP2 = -40 AP3 = -80 (x1, y1, z1) AP1 = -40 AP2 = -60 AP3 = -95 AP1 = -40 AP2 = -70 AP3 = -85 AP1 = -35 AP2 = -90 AP3 = -55 (x2, y2, z1) … (x3, y3, z1) (x4, y4, z1) (…) Radio Map AP1 = -50 AP2 = -40 AP3 = -85
  • 64. Improving WLAN Positioning with Weighted Graphs
  • 66. IFC file PIFC file •Standard format •Big file, used only on PC •Can be read using specialized toolkit •Unaligned to real word •Non-standard XML-based format •Small file, can be used on pocket PC •Extendable for different types of objects •Can be read using XML parser •Aligned to WGS84 Foreach (building, storey) extract: Walls, spaces, access points … Conversion on user machine or Streamspin service
  • 67. Infrastructure-Based Positioning • iPhone and WP 7 does not support device-based positioning. • Instead, a ”Wi-Fi sniffer” infrastructure is required. • Positioning is done on Infrastructure-Based Positioning Service 67
  • 68. Building the radio maps • Two types of radio maps: 1. Device-based radio map – Measurement done locally and uploaded. 2. Infrastructure-based radio map • The Android app builds both radio maps in one go. 68 1.A) bool StartMeasuringAtBoundLocation( string clientMac, int buildingId, int vertexId) 1.B) bool StartMeasuringAtUnboundLocation( string clientMac, int buildingId, int latE6, int lonE6, int alt) 2) bool StopMeasuring(string clientMac) 3) int SaveMeasurement(string clientMac)
  • 69. Setting up a Wi-Fi sniffer infrastructure • Buy appropriate equipment or use/ modify existing ( http://wiki.openwrt.org/toh/start ) • Update firmware (contact us for instructions) • Start sniffing! • I.e., start sending measurement reports of the form [sniffer_mac, time, RSSI, client_mac] to our Infrastructure-Based Positioning Service. • Contact us regarding hosting of infrastructure-based pos. service: – Use smartcampus server – Use your own server – Use an intermediary to filter measurement reports 69
  • 70. 3rd Positioning Service • Infrastructure-Based, Device-Assisted Positioning • For positioning and tracking of IoT devices 70 * RTX41xx: http://www.rtx.dk/RTX4100_Wi-Fi_module-3921.aspx
  • 71. Integration • PIM (Calandar) http://way.askcody.dk/d.php?id=1644 • Intelligent signs • Social Networks • Intelligent Buildings
  • 72. 72 Interacting with smart buildings HomePort Door locks
  • 73. Conlan Demo • Objective: Turn on Conlan device when mobile device is within 10 meters 73
  • 74.
  • 75.
  • 76. Solution from MapsPeople • Geo Location Manager
  • 77.