340 likes | 516 Views
Real-Time Java Fact-no-fiction Java in technical automation. Paul Wijntjes Consultant Turnkiek Technical Systems. Contents. Introduction Java in embedded Real Time Java Demonstrator. Offices in: Amersfoort Delft Eindhoven. R &D. Traffic & Transport. Inproduct sw. Productie Bdr.
E N D
Real-Time JavaFact-no-fictionJava in technical automation Paul Wijntjes Consultant Turnkiek Technical Systems
Contents • Introduction • Java in embedded • Real Time Java • Demonstrator
Offices in: • Amersfoort • Delft • Eindhoven
R &D Traffic & Transport Inproduct sw Productie Bdr. Java V&S systemen Defense Embedded Prod. Autom. Advanced machines Microsoft Network Comp Utilities Unix /Linux Telecom Mission statement: • Early adopter • Quality solutions • Cost effective and future aimed • In technical industrial & scientific market • Reliable and valued partner • Give the customer peace of mind • Commitment = commitment • Small things matter • Treat and respect people as people Market segments Service areas. Platforms
Contents • Introduction • Java in embedded • Real Time Java • Demonstrator
YEAR 2010 Number of subscribers/units (millions) People Automobiles Bicycle Portable PCs Motorcycles, Boats, Vending Machines etc Pets (dogs and cats etc) 120 100 60 50 10 20 360 Total Forecast by DoCoMo based on “Trends in Household Consumption” by Economic Planning Agency, and published materials by Japan Pet Food Manufacturer’s Association etc Not only people
JavaTM 2 Platform ??? Pro File Pro File Pro File Pro File Pro File Pro File Pro File Pro File Pro File Profiles J2EE APIs J2SE APIs J2ME APIs Configu- rations Java Virtual Machine Hardware / Operating System Thanks to Chris Laffra, OTI
Why Java in Embedded ? • More reliable • More productive • Object oriented • High level • Component model • Inherent networking • Less porting effort (if any) • Machine code skills deteriorating Descartes
Evolution -> Revolution -2 y now +2 y SE ME EE
Contents • Introduction • Java in embedded • Real Time Java • Demonstrator
Specification • J-Consortium, RTJWG • NewMonics, HP, Microsoft, Aonix,... • JCP, JSR-0000001 • Specs • Reference implementation • Test suite • Expected Q4-2001
Guiding Principles • Applicability to particular Java environments • Backward compatibility • Write once, run anywhere • Current practice versus advanced future features • Predictable execution • No syntactic extension
RTSJ: 8 modified areas 1. Thread scheduling and dispatching 2. Memory management 3. Synchronization and resource sharing 4. Physical memory access 5. Asynchronous event handling 6. Asynchronous transfer of control 7. Asynchronous thread termination 8. Exceptions
1. Thread scheduling and dispatching • Introduction of class RealTimeThread • Predictable execution • Unanticipated scheduling algorithms can be used • Preemptive, Priority-based, FIFO within priority with at least 28 unique priority levels
Priority Rt-thread GC Rt-thread Pipe Java thread Time How does it work?
2. Memory management • Garbage collection • Basic memory areas • Scoped memory • Physical memory • Immortal memory • Heap memory
3. Synchronisation and resource sharing • Prevent priority inversion • Monitor behavior policy can be set per object. • Determinisme
Priority inheritance Priority Thread 2 Lock Thread 1 Unlock Object Lock Time
4. Physical memory access • Byte-level access to physical memory • Construction of objects in physical memory
5. Asynchronous event handling • Two classes • AsyncEvent • AsynchEventHandler • Implemented scheduler for execution
AsyncEvent (how it works) bindTo() Real world event Handler implements Schedulable and Runnable interfaces. AsyncEvent addHandler() abstract class AsyncEventHandler: run() // final handleAsyncEvent() getAndDecrementPendingFireCount()
6. Asynchronous transfer of control (ATC) • Execution transfer • Time bound • ATC and asynchronous event handling can be combined.
7. Asynchronous thread termination • Safely transfer of control • New mechanism for stopping threads
8. Exceptions • New several exceptions • New treatment of exceptions • asynchronous transfer of control • memory allocation
Implementations • TimeSys, reference implementation JSR-1 • OTI/IBM J9 • Esmertec, JBed • Insignia Solutions, Jeode • aJile Systems
Contents • Introduction • Java in embedded • Real Time Java • Demonstrator
Architecture Application OTI’s J9 + Real-Time Extensions JNI QNX Neutrino Drivers PC 104 board motorcontrolers
Visual Age Micro Edition Trace analyzer Memory analyzer After running 3 threads “simultaneously”
Lessons learned • Real-Time Java is Really Real-Time • Implementation of specs not complete • OTI’s J9 and VAME work very well
Summary • Expected exponential growth in J2ME applications • Real-Time Java nearly final • It’s time to make plans to use Real Time Java
More information • java.sun.com • www.rtj.org • www.drtsj.org • www.embedded.oti.com • www.turnkiek.nl • wijntjes@turnkiek.nl
Thank you For your time and attention