Presentation is loading. Please wait.

Presentation is loading. Please wait.

Context-related issues in real-time systems

Similar presentations


Presentation on theme: "Context-related issues in real-time systems"— Presentation transcript:

1 Context-related issues in real-time systems

2 Context awareness Context Context-awareness
The state of the environment in which an application operates Potential attributes: location, identity, activity, bandwidth, power, etc. Context-awareness Ability to extract, interpret, and use context information obtained from its environment

3 Context-Awareness Sensors/Actuators Context-Awareness

4 In the Core … Various different content formats are emerging … WML
Real Flash PNG GIF DHTML HTML ASP MPEG1 Quicktime Windows Media JPEG PHP MPEG4

5 … At the Edge … Various different user agents and platforms are emerging … Embedded Devices WAP Phone Desktop Integrated Chip PDA Laptop Palmtop

6 Real-time requirements in context-aware applications
Context-aware applications interact with physical environment Inherently has timeliness requirements. Correctness of context information Correctness of actions based on context information Types of timeliness requirements Hard real-time Soft real-time Time-free

7 Challenges and requirements for context-aware real-time services
Application level Capture of context data Gathering data from unreliable multi-modal sensors Uncertainty of context data Representation of context data Interpretation of context data Synchrony Synchronous operation cannot be adopted to embedded systems. Context data should be fed asynchronously. Privacy Scalability

8 Challenges and requirements for context-aware real-time services
Middleware level Adaptability Provides various levels of QoS Cope with resource constraints Resource preservation Resource allocation and scheduling for satisfying various QoS Collaboration Context-aware applications can collaborate between entities. Group communication Synchrony Dynamic reconfiguration of connections and entities Scalability Fault-tolerance & consistency

9 Challenges and requirements for context-aware real-time services
Networking level Adaptability Provides various levels of QoS Cope with resource constraints Limited bandwidth availability Unpredictable latency Heterogeneity End-to-end QoS

10 What makes up Context-Aware Framework?
We’ve got information (context)! We’ve got agents! We’ve got sensors!

11 Agents Agents are a software abstraction.
An agent is a program that assists people and acts on their behalf. Agents are: reactive, autonomous, and goal-driven. For OO programmers… Objects are described in terms of methods Agents are described in terms of behaviors.

12 Information Context in our framework is Semantic data.
Context is described in a semantic ontology. (OWL and RDF). An ontology is typically a hierarchical data structure containing all the relevant entities and their relationships and rules within a domain of knowledge. Quoting wikipedia Image Creative Commons by Claudecf

13 Making Agents Smarter…
Using formal ontologies allows agents to share beliefs in a precise manner. Ontologies create inferred knowledge… Example I know Abernethy 210 is a space in a structure called Abernethy, and that structure is different from a structure called Manning.

14 Making Agents Smarter…
Using a Rules Engine allows agents to make deductions. Example If this is a classroom, and there is a class scheduled, and you are the teacher, and you have a syllabus => I should fire up your presentation and start recording. I should take attendance.

15 What is a Rules Engine? Rules engines are tools for building intelligent software, or expert systems. Rules collect facts about the world, and continuously apply rules to those facts. Rules engines allow agents to make deductions and plans by looking at the context information.

16 When should I use a Rule Engine?
Complicated logic (not 1+1 = 2)‏ Changes often (whatever that means)‏ Traditional approaches are unmaintainable

17 Rules Rules are declarative Follow the pattern
IF <condition> THEN <consequence> A rule firing (execution) can change the state of the Working Memory therefore possibly triggering other rules to fire

18 Problems with rule engines
How can it be implemented? Dynamically loadable Heterogeneous environment Changes often Solutions Machine-independent language Interpreter/script language Open standard  Use of XML  JAVA is (virtually) the only solution (until now).

19 Problems of JAVA applications in real-time systems
Thread management Priority-based scheduling is not supported. Class loading Class loading is delayed until it is referenced. How long it takes? – We don’t know. Garbage collection System is suspended during GC How long it takes? How often it occurs? Compile Java byte codes are interpreted at run time. How long it takes to interpret? How long it takes to run?

20 Real-Time Specification for Java
RTSJ for short First JSR request Still not completely finished Implementations TimeSys RI Purdue OVM Real Time Java

21 RTSJ Guiding Principles
Backward compatibility to standard Java Write Once, Run Anywhere Current real-time practice Predictable execution No Syntactic extension Allow implementation flexibility Real Time Java

22 RTSJ Overview Clear definition of scheduler
Priority inheritance protocol NoHeapRealtimeThread Scoped memory to avoid GC Low-level access through raw memory High resolution time and timer Real Time Java

23 RTSJ: Scheduling Standard Java offers no guarantee Fixed priority
Even non preemptive JVM possible Fixed priority FIFO within priorities Minimum of 28 unique priority levels GC priority level not defined Real Time Java

24 RTSJ: Memory Areas GC collected Heap Immortal memory Scoped memory
LTMemory VTMemory Physical memory Different time properties Access to HW devices! Real Time Java

25 RTSJ: Thread Types Extensions to java.lang.Thread
RealTimeThread NoHeapRealTimeThread AsyncEventHandler Scoped and immortal memory for NHRTT Strict assignment rules Not easy to use Real Time Java

26 RTSJ: Synchronization
Use synchronized Priority inversion possible in standard Java Priority inheritance protocol Priority ceiling emulation protocol Real Time Java

27 RTSJ: Scoped Memory Cumbersome programming style
New class for each code part class UseMem implements Runnable { public void run() { // inside scoped memory Integer[] = new Integer[100]; ... } // outside of scoped memory // in immortal? at initialization? LTMemory mem = new LTMemory(1024, 1024); UseMem um = new UseMem(); // usage computation() { mem.enter(um); Real Time Java

28 Asynchronous Event Handler
Difference between bound an unbound Implementation hint at application level No functional difference for the application Better: only one type Specify a minimum latency at creation Runtime system decides about implementation Real Time Java

29 Garbage Collection? An essential part of Java
Without GC it is a different computing model RTSJ does not believe in real-time GC Real-time collectors evolve Active research area For You? Real Time Java

30 RTSJ Issues J2SE library: On small systems: Heap usage not documented
OS functions can cause blocking On small systems: Large and complex specification Expensive longs (64 bit) for time values Real Time Java


Download ppt "Context-related issues in real-time systems"

Similar presentations


Ads by Google