Title: Loaded classes may be seen only by called methods an
1OSGi and Real Time
- Kelvin Nilsen, Ph.D., CTO
2For traditional soft real time with J2ME
- It would be nice if each OSGi bundle could
- Establish an expected memory utilization, and
- An expected CPU consumption
- Based on experimentation on the targeted platform
to determine resource needs on this platform - And have these resource budgets guaranteed by
the platform
3New Standards Emerging for Safety-Critical Java
- No garbage collection
- Safe stack allocation
- Very small memory footprint
- Simplicity of run-time environment
- Throughput efficiency of optimized C
- We need an OSGi-like capability in this
environment, but existing OSGi is too big
4The Thread Stack Model
Initially, the run-time stack (grows downward)
for the main thread represents all non-immortal
memory.
5The Thread Stack Model
The main thread may spawn additional threads,
setting aside part of its own stack to represent
the stack memory for the spawned threads.
Any of the spawned threads may in turn carve up
its stack in order to spawn grandchildren
threads.
6The Thread Stack Model
7The Thread Stack Model
The parent thread is required to join with its
spawned threads before returning from the context
from which it spawned those threads..
Thread-3
Thread-2
Thread-1
8Dynamic Class Loading
- Classes are loaded into ThreadStack memory as
scoped objects - Loaded classes may be seen only by called methods
and descendent threads
9Loading classes within thread stacks
The main thread may dynamically load classes into
its privatescope. These loaded classes can be
seen by called methods.
Subsequently spawned subthreads may also see the
loadedclasses. In fact, the spawned subthreads
may even be instancesof a dynamically loaded
NoHeapRealtimeThread subclass.
10Rebudgeting memory
Any thread may voluntarily release its memory and
have that memory rebudgeted to serve other
purposes
11Rebudgeting memory
Any thread may voluntarily release its memory and
have that memory rebudgeted to serve other
purposes
12Rebudgeting memory
Any thread may voluntarily release its memory and
have that memory rebudgeted to serve other
purposes
13Cooperating HRT Components
Pico HardReal-Time Execution Engine
PERC Virtual Machine
14TraditionalJava Registry
TraditionalJava
TraditionalJava.publish(deviceXYZ, x)
15TraditionalJava Registry
Hard Real-Time Domain
HardRealTimeDomain.lookup(deviceXYZ)