design patterns in real-time systems

Upload: meepav

Post on 07-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Design Patterns in Real-Time Systems

    1/24

    DESIGN PATTERNS FOR REAL-TIME

    SYSTEMS

    Neelakantam Pavani

    M.Tech CSE

    10B81D5810

  • 8/6/2019 Design Patterns in Real-Time Systems

    2/24

    DESIGN PATTERNS

    Each pattern describes a problem which

    occurs over and over again in our

    environment, and then describes the core ofthe solution to that problem, in such a way

    that you can use this solution a million

    times over, without ever doing it the same

    way twice.

    Christopher Alexander

  • 8/6/2019 Design Patterns in Real-Time Systems

    3/24

    DESIGN PATTERNS BASICS

    A design pattern is a generalized solution to a

    commonly occurring problem.

    Pattern hatching : The problem of identifying the

    nature of the problem and examining thepatterns library for the best ones to apply.

    Pattern mining : The identification and capture of

    new patterns to add to the library.

    Pattern instantiation: It is applying the patternto a particular collaboration to gain the benefits

    of the pattern.

  • 8/6/2019 Design Patterns in Real-Time Systems

    4/24

    PATTERNHATCHING LOCATING THE

    RIGHT PATTERNS

  • 8/6/2019 Design Patterns in Real-Time Systems

    5/24

    BASIC STRUCTURE OFDESIGN

    PATTERNS

    According to Gamma a pattern has four important

    aspects:

    Name : The name provides a handle or means

    to reference the pattern. Purpose : The purpose provides the problem

    context and the QoS aspects the pattern seeks to

    optimize. The purpose identifies the kinds of

    problem contexts where the pattern might be

    particularly appropriate.

    Solution : The Solution is the pattern itself.

    Consequences : The Consequences are the set of

    pros and cons of the use of the pattern

  • 8/6/2019 Design Patterns in Real-Time Systems

    6/24

    REAL-TIME SYSTEMS

    Areal-time system is a software system where thecorrect functioning of the system depends on theresults produced by the system and the time at whichthese results are produced.

    Areal-time system is a system whosespecification includes both logical and temporal

    correctness requirements.

    Logical Correctness: Produces correct outputs.

    Temporal Correctness: Produces outputs at the

    right time.

  • 8/6/2019 Design Patterns in Real-Time Systems

    7/24

    REAL-TIME SYSTEMS

    Ahard real-time system is a system whoseoperation is incorrect if results are not producedaccording to the timing specification.

    Asoft real-time system is a system whoseoperation is degraded if results are not producedaccording to the specified timing requirements.

  • 8/6/2019 Design Patterns in Real-Time Systems

    8/24

    CHARACTERISTICS OF REAL-TIME SYSTEMS

    Event-driven, reactive.

    High cost of failure.

    Concurrency/multiprogramming.

    Stand-alone/continuous operation.

    Reliability/fault-tolerance requirements.

    Predictable behavior

  • 8/6/2019 Design Patterns in Real-Time Systems

    9/24

    HARD & SOFT REAL-TIME SYSTEMS

    Characteristic Hard Real-Time Soft Real-Time

    Response Time Required Desired

    Peak-loadperformance Predictable Degraded

    Control of pace Environment Computer

    Safety Often critical Non- critical

    Size of data files Small/medium Large

    Redundancy type Active Checkpoint-recovery

    Data integrity Short-term Long-term

    Error detection Autonomous User assisted

  • 8/6/2019 Design Patterns in Real-Time Systems

    10/24

    REAL-TIME DESIGN PATTERNS

    Priority Ceiling

    Preemptive Multitasking

    Proxy

    MicroKernel

    Watchdog

  • 8/6/2019 Design Patterns in Real-Time Systems

    11/24

    PRIORITYCEILING PATTERN

    The Priority Ceiling Pattern, or Priority Ceiling

    Protocol (PCP) as it is sometimes called,

    addresses both issues of bounding priority

    inversion (and hence bounding blocking time)

    and removal of deadlock.

  • 8/6/2019 Design Patterns in Real-Time Systems

    12/24

    PRIORITYCEILING PATTERN STRUCTURE

  • 8/6/2019 Design Patterns in Real-Time Systems

    13/24

    COLLABORATION ROLES

    Abstract Thread

    Concrete Thread

    Mutex

    Scheduler

    Shared Resource

    Task Control Block

  • 8/6/2019 Design Patterns in Real-Time Systems

    14/24

    PREEMPTIVE MULTITASKING PATTERN

    In Pre-emptive Multitasking, the tasks priority

    and readiness are the determining factors that

    need to be considered when queuing processes.

    Priority based scheduling systems operate ineither static or dynamic mode.

    In static mode, the tasks priority is set before

    run-time, and cannot be changed while executing.

    Dynamic mode is more widely used in real-timesystems, because it can be difficult to know

    which tasks will be the most critical at any given

    time, before that time.

  • 8/6/2019 Design Patterns in Real-Time Systems

    15/24

    PREEMPTIVE MULTITASKING PATTERN

    There are three common strategies to follow

    when using the dynamic pattern :

    Earliest Deadline Least Laxity

    Maximum Urgency First

  • 8/6/2019 Design Patterns in Real-Time Systems

    16/24

    MICROKERNEL PATTERN

    The Microkernel architectural pattern applies to

    software systems that must be able to adapt to

    changing system requirements. It separates a

    minimal functional core from extended

    functionality and customer-specific parts.

    The Microkernel pattern structures the software

    architecture into a set of layers. This

    organization has following advantages:

    Portability

    Reuse

    Scaled-down applications

  • 8/6/2019 Design Patterns in Real-Time Systems

    17/24

    MICROKERNEL PATTERN

  • 8/6/2019 Design Patterns in Real-Time Systems

    18/24

    PROXYPATTERN

    Intent

    Provide a surrogate or placeholder for another object to

    control access to it

    Also Known AsSurrogate

    There are situations in which a client does not or

    can not reference an object directly, but wants to

    still interact with the object

    A proxy object can act as the intermediary

    between the client and the target object

  • 8/6/2019 Design Patterns in Real-Time Systems

    19/24

    PROXYPATTERN

  • 8/6/2019 Design Patterns in Real-Time Systems

    20/24

    PROXYPATTERNAPPLICABILITY

    Remote Proxy

    Virtual Proxy

    Protection Proxy

    Smart Reference

  • 8/6/2019 Design Patterns in Real-Time Systems

    21/24

    COLLABORATIONS & CONSEQUENCES

    Proxy forwards request to RealSubject when

    appropriate, depending on the kind of proxy.

  • 8/6/2019 Design Patterns in Real-Time Systems

    22/24

    WATCHDOG PATTERN

    Provide a very simplistic and low-cost solution to

    detect and handle failures and faults during the

    execution of safety-critical systems.

    The watchdog is a low-cost solution for ensuring

    the liveness of a component

  • 8/6/2019 Design Patterns in Real-Time Systems

    23/24

    WATCHDOG PATTERN

  • 8/6/2019 Design Patterns in Real-Time Systems

    24/24

    QUERIES