real-time java fact-no-fiction java in technical automation

34
Copyright © 2001 Page 1 04-07-22 Real-Time Java Fact-no-fiction Java in technical automation Paul Wijntjes Consultant Turnkiek Technical Systems

Upload: walt

Post on 31-Jan-2016

35 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Real-Time Java Fact-no-fiction Java in technical automation

Copyright © 2001 Page 122-04-23

Real-Time JavaFact-no-fiction

Java in technical automation

Paul Wijntjes

Consultant

Turnkiek Technical Systems

Page 2: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 2

Contents

Introduction

Java in embedded

Real Time Java

Demonstrator

Page 3: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 4: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 5: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 5

Contents

Introduction

Java in embedded

Real Time Java

Demonstrator

Page 6: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 7: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 8: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 9: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 9

Evolution -> Revolution

SEEE ME

-2 y

now

+2 y

Page 10: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 10

Contents

Introduction

Java in embedded

Real Time Java

Demonstrator

Page 11: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 11

Yes, but……

What about Real-Time?

Page 12: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 13: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 14: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 15: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 16: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 16

How does it work?

Rt-thread

Time

Priority

Java thread

GC

Rt-thread

Pipe

Page 17: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 17

2. Memory management

Garbage collection Basic memory areas

- Scoped memory

- Physical memory

- Immortal memory

- Heap memory

Page 18: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 18

3. Synchronisation and resource sharing

Prevent priority inversion Monitor behavior policy can be set per object. Determinisme

Page 19: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 19

Priority inheritance

Object

Thread 1

Thread 2

Lock Unlock

Lock

Priority

Time

Page 20: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 20

4. Physical memory access

Byte-level access to physical memory

Construction of objects in physical memory

Page 21: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 21

5. Asynchronous event handling

Two classes AsyncEvent

AsynchEventHandler

Implemented scheduler for execution

Page 22: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 23: Real-Time Java Fact-no-fiction Java in technical automation

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.

Page 24: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 24

7. Asynchronous thread termination

Safely transfer of control

New mechanism for stopping threads

Page 25: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 25

8. Exceptions

New several exceptions

New treatment of exceptions

asynchronous transfer of control

memory allocation

Page 26: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 26

Implementations

TimeSys, reference implementation JSR-1

OTI/IBM J9

Esmertec, JBed

Insignia Solutions, Jeode

aJile Systems

Page 27: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 27

Contents

Introduction

Java in embedded

Real Time Java

Demonstrator

Page 28: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 28

Real time demonstrator

Page 29: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 30: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 30

Visual Age Micro Edition

After running 3 threads “simultaneously”

Trace analyzer Memory analyzer

Page 31: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 32: Real-Time Java Fact-no-fiction Java in technical automation

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

Page 33: Real-Time Java Fact-no-fiction Java in technical automation

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

[email protected]

Page 34: Real-Time Java Fact-no-fiction Java in technical automation

22-04-23 Copyright © 2001 Page 34

Thank you

For your time and attention