programming models in pervasive spaces part 2 cnt 5517-5564 dr. sumi helal & dr. eun-sun cho...

21
Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun- Sun Cho Computer & Information Science & Engineering Department University of Florida, Gainesville, FL 32611 {helal, escho}@cise.ufl.edu

Post on 18-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Programming Models in Pervasive Spaces

Part 2 CNT 5517-5564

Dr. Sumi Helal & Dr. Eun-Sun ChoComputer & Information Science & Engineering Department

University of Florida, Gainesville, FL 32611{helal, escho}@cise.ufl.edu

Page 2: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Reading Materials1. H. Yang and A. Helal, "Safety Enhancing Mechanisms for Pervasive Computing Systems in

Intelligent Environment", In Proceedings of the Middleware Support for Pervasive Computing Workshop, held in conjunction with IEEE PerCom 2008, Hong Kong, March 2008. (pdf)

2. Randell, B.: Dependable pervasive systems. In: SRDS, page 2. IEEE Computer Society Press, (2004)

3. R. Bose, A. Helal, V. Sivakumar and S. Lim, "Virtual Sensors for Service Oriented Intelligent Environments,"  Proceedings of the Third IASTED International Conference on Advances in Computer Science and Technology, Phuket, Thailand, April 2-4, 2007

4. S. Chetan, A. Ranganathan, and R. Campbell. Towards fault tolerance pervasive computing. Technology and Society Magazine, IEEE, 24(1):38--44, Spring 2005.

5. P. Hu, J. Indulska, R. Robinson, An Autonomic Context Management System for Pervasive Computing, Percom 2008

6. Kulkarni, D., Tripathi, A.: A Framework for Programming Robust Context-Aware Applications. In: IEEE Transactions on Software Engineering, vol. 36, no.2, IEEE Computer Society Press (2010)

7. Damasceno, K., Cacho, N., Garcia, A., Romanovsky, A., Lucena, C., : Context-Aware Exception Handling in Mobile Agent Systems: The MoCA Case. In: Software engineering for large-scale multi-agent systems, pp37 – 44, ACM New York (2006)

Page 3: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Programming Models

• Service oriented models– More expressive, Less safe

• Context driven models– Less expressive, Safer

• Safety oriented models √– More expressive, Safer

Page 4: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Trustworthiness of a Computing System

• The trustworthiness of a computing system (including a pervasive system) can be defined by its dependability

• Dependability is comprised of: − reliability, availability, integrity, safety and

maintainability

• Online transaction processing systems have emphasized availability, maintainability and integrity.

– The solutions also have helped to facilitate less emphasized attributes like safety.

Page 5: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Exception Handling Technologies

Fault Management Technologies

Dependable systems

safety

relia

bilit

yintegrity

maintainabilityavailability

Page 6: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Trustworthiness of a Pervasive System

• In pervasive systems, safety (especially, user-centered safety) deserves more attention

– abnormalities in pervasive systems could be critical problems to users’ safety.

– Examples:• Conflicting usage of shared resources• Invalid operational directives• Risks of conflicting side effects

Page 7: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Trustworthiness of a Pervasive System (cont’d)

• Solutions to traditional dependability may help user-centered safety in pervasive systems, but they are only partially helpful

• More direct attention on safety is needed• Useful tools

– Fault management technologies– Exception handling

Page 8: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Fault Management Technologies

• Goal : continuous, acceptable-quality operation of a system, even in presence of faults. – based on a closed control loop of monitoring, detection

and reaction

• System-wide safety support– able to monitor the interactions between different

applications from system-wide point of view– does not consider the semantics of individual

applications– the remedies of the fault are simple, usually limited to

halting, reconfiguration or redundancy.

Page 9: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Exception Handling

• Allows programmer-described abnormal cases to be detected and remedied – according to the handler programs.

• Program-wide safety support– exceptions and the handlers based on

application/service semantics. – needs any additional coordinator– exception handling support in a general purpose

language (C++/C#/Java) may complicate the application codes

Page 10: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

aware of Individualapplication semantics

aware ofpresence of

multiple applications

application specificsafety support

System-widefault management

handlers defined by programmers

retry, halt or reporting to users

Program-WideSafety Support

System-wideSafety Support

Page 11: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Previous Work

• Usually focuses either on fault management or on exception handling

• Some of the existing methods consider both fault detection and exception handling

• They assume a single program in a system, without considering interactions of independent programs

Page 12: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Previous Work (cont’d)

• Detection – heartbeat based fault detection and remedy in a

program [4]

• Remedy – reconstructing the organization of the program (the

execution path) [5]– embedding human “roles” explicitly as subjects to

handle exceptions [6]– based on existing exception handling tools in

C++/C#/Java [7]– Virtual sensors [2]

Page 13: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Safety Oriented Models

• Safety oriented programming models needed to allow multiple independent programming units to run on a system safely

• Allowing detection and handling of unsafe states in application semantics aware way.

• Employ both system-wide and program-wide safety support

Page 14: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

System-Wide Safety Supports

• “Global safety knowledge base”– Stakeholders such as devices manufactures, space

owners and users specify their individual concerns into their safety knowledge through a domain-independent ontology.

– By integrating and maintaining the knowledge base, the pervasive system keeps a coherent understanding of the overall safety issues in the space

Page 15: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

System-Wide Safety Supports(cont’d)

• A pervasive system dictates, prioritizes, and addresses the various concerns to achieve maximum overall safety based on the knowledge base

• Works best when multiple services and devices are entangled.

Page 16: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Program-wide Safety Support

• A programmer has the best knowledge of the intricacies and the safety needs of his program– More powerful tools needed to address the internal

safety issues within the program itself.– Like enhanced exception handling techniques – programmers are able to direct control to manage

safety risks within their own programs.

• A fine-grain, and more customized support for safety.

Page 17: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

More on Program-Wide Support

• A Situation– means a temporal sequence of contexts that can

cause abnormality in complicated pervasive environments.

– allows sophisticated description of exceptions,

• Asynchronous exception detection – Avoid distracting programmers from programming on

application’s main flow

Page 18: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Before the Execution During the Execution

Exceptions and handlersin programs

PreprocessingTools

HandlerInvocation

ExceptionDetection

ExceptionRegistration

ContextMonitor

Exception and Handlers

Repository

Runtime Exception Engine

RuntimeService

ExecutionEnvironment

Physical Worldwith

Context Reader/Writer

Page 19: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Program-Wide Exception Registration

• Exceptions are sometimes program-local but in many cases, they are related to system-wide abnormalities.

• The programmer is supposed to register the exception and handler definitions into the Runtime Exception Engine– also checked to meet the system-wide safety

specifications; otherwise discarded and warn the programmer (by assistance of specialized tools.)

– need to be verified again against the noticeable modification of the system and knowledgebase

Page 20: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Program-Wide Exception Handling

• If an exception is detected, − Runtime Exception Engine will try to find an

appropriate handler and execute it. – each program maintains its own queue of context data to

facilitate scenario-based abnormality detection, by consulting from context monitor.

• When preventing an impermissible context fails, in spite of protection of context locks,

– execution of an exception handler can be initiated.

Page 21: Programming Models in Pervasive Spaces Part 2 CNT 5517-5564 Dr. Sumi Helal & Dr. Eun-Sun Cho Computer & Information Science & Engineering Department University

Discussions

• Safety problems are critical– Adequate support for safety is needed

• Program-wide safety support– Not for the cases that multiple tasks are

interacting to each other – Still valuable

• Allows sophisticated and customized handling of erroneous cases