real-time java fact-no-fiction java in technical automation
Post on 31-Jan-2016
30 Views
Preview:
DESCRIPTION
TRANSCRIPT
Copyright © 2001 Page 122-04-23
Real-Time JavaFact-no-fiction
Java in technical automation
Paul Wijntjes
Consultant
Turnkiek Technical Systems
22-04-23 Copyright © 2001 Page 2
Contents
Introduction
Java in embedded
Real Time Java
Demonstrator
22-04-23 Copyright © 2001 Page 3
T urnk ie kT e c hnic a l
S y s te m s B V
T urnk ie kB us ine s s
Im pro v e m e nt B V
T urnk ie kIT
S e rv ic e s B V
T urnk ie kP ro c e s s
C o ntro l B V
T urnk ie kH o lding
Im te c h IC T
Offices in:
• Amersfoort
• Delft
• Eindhoven
22-04-23 Copyright © 2001 Page 4
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
Mission statement:
Inproduct swV&S systemenProd. Autom.Network Comp
R &DTraffic & TransportProductie Bdr.DefenseAdvanced machinesUtilitiesTelecom
Java
Embedded
Microsoft
Unix /Linux
Platforms Service areas.
Market segments
22-04-23 Copyright © 2001 Page 5
Contents
Introduction
Java in embedded
Real Time Java
Demonstrator
22-04-23 Copyright © 2001 Page 6
Not only peopleYEAR 2010 Number of subscribers/units (millions)
People
Automobiles
Bicycle
Portable PCs
Motorcycles, Boats, Vending Machines etc
Pets (dogs and cats etc)
Total
120 100
60
50
10
20
360Forecast by DoCoMo based on “Trends in Household Consumption” by Economic Planning Agency,and published materials by Japan Pet Food Manufacturer’s Association etc
22-04-23 Copyright © 2001 Page 7
ProFile
ProFile
JavaTM 2 Platform
Hardware / Operating SystemHardware / Operating System
Java Virtual MachineJava Virtual Machine
J2EE APIsJ2EE APIs J2SE APIsJ2SE APIs J2ME APIsJ2ME APIs
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
ProFile
Profiles
Configu-rations
???
Thanks to Chris Laffra, OTI
22-04-23 Copyright © 2001 Page 8
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
22-04-23 Copyright © 2001 Page 9
Evolution -> Revolution
SEEE ME
-2 y
now
+2 y
22-04-23 Copyright © 2001 Page 10
Contents
Introduction
Java in embedded
Real Time Java
Demonstrator
22-04-23 Copyright © 2001 Page 11
Yes, but……
What about Real-Time?
22-04-23 Copyright © 2001 Page 12
Specification
J-Consortium, RTJWG
- NewMonics, HP, Microsoft, Aonix,...
JCP, JSR-0000001
- Specs
- Reference implementation
- Test suite
- Expected Q4-2001
22-04-23 Copyright © 2001 Page 13
Guiding Principles
Applicability to particular Java environments Backward compatibility Write once, run anywhere Current practice versus advanced future features Predictable execution No syntactic extension
22-04-23 Copyright © 2001 Page 14
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
22-04-23 Copyright © 2001 Page 15
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
22-04-23 Copyright © 2001 Page 16
How does it work?
Rt-thread
Time
Priority
Java thread
GC
Rt-thread
Pipe
22-04-23 Copyright © 2001 Page 17
2. Memory management
Garbage collection Basic memory areas
- Scoped memory
- Physical memory
- Immortal memory
- Heap memory
22-04-23 Copyright © 2001 Page 18
3. Synchronisation and resource sharing
Prevent priority inversion Monitor behavior policy can be set per object. Determinisme
22-04-23 Copyright © 2001 Page 19
Priority inheritance
Object
Thread 1
Thread 2
Lock Unlock
Lock
Priority
Time
22-04-23 Copyright © 2001 Page 20
4. Physical memory access
Byte-level access to physical memory
Construction of objects in physical memory
22-04-23 Copyright © 2001 Page 21
5. Asynchronous event handling
Two classes AsyncEvent
AsynchEventHandler
Implemented scheduler for execution
22-04-23 Copyright © 2001 Page 22
AsyncEvent (how it works)
AsyncEvent
bindTo()
abstract class AsyncEventHandler:
run() // final
handleAsyncEvent()
getAndDecrementPendingFireCount()
addHandler()
• Handler implements Schedulable and Runnable interfaces.
Real world event
22-04-23 Copyright © 2001 Page 23
6. Asynchronous transfer of control (ATC)
Execution transfer
Time bound
ATC and asynchronous event handling can be combined.
22-04-23 Copyright © 2001 Page 24
7. Asynchronous thread termination
Safely transfer of control
New mechanism for stopping threads
22-04-23 Copyright © 2001 Page 25
8. Exceptions
New several exceptions
New treatment of exceptions
asynchronous transfer of control
memory allocation
22-04-23 Copyright © 2001 Page 26
Implementations
TimeSys, reference implementation JSR-1
OTI/IBM J9
Esmertec, JBed
Insignia Solutions, Jeode
aJile Systems
22-04-23 Copyright © 2001 Page 27
Contents
Introduction
Java in embedded
Real Time Java
Demonstrator
22-04-23 Copyright © 2001 Page 28
Real time demonstrator
22-04-23 Copyright © 2001 Page 29
PC 104 boardPC 104 board
QNX NeutrinoQNX Neutrino
OTI’s J9 + Real-Time ExtensionsOTI’s J9 + Real-Time Extensions
ApplicationApplication
DriversDrivers
motorcontrolersmotorcontrolers
Architecture
22-04-23 Copyright © 2001 Page 30
Visual Age Micro Edition
After running 3 threads “simultaneously”
Trace analyzer Memory analyzer
22-04-23 Copyright © 2001 Page 31
Lessons learned
Real-Time Java is Really Real-Time
Implementation of specs not complete
OTI’s J9 and VAME work very well
22-04-23 Copyright © 2001 Page 32
Summary
Expected exponential growth in J2ME applications
Real-Time Java nearly final
It’s time to make plans to use Real Time Java
22-04-23 Copyright © 2001 Page 33
More information
java.sun.com
www.rtj.org
www.drtsj.org
www.embedded.oti.com
www.turnkiek.nl
wijntjes@turnkiek.nl
22-04-23 Copyright © 2001 Page 34
Thank you
For your time and attention
top related