Real-time Software Design

  • Uploaded by: ANKIT AGG
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Real-time Software Design as PDF for free.

More details

  • Words: 604
  • Pages: 19
Real-time Software Design

Design Patterns for Real-Time Systems Guide Faculty Mrs. Barkha Vijh Presented By; kaushik

Mayank

Introduction 





A Design Pattern is a general reusable solution to a commonly occurring problem in software design.[1] A Distributed Computing System is a method of computer processing in which different parts of a program run simultaneously on two or more computers that are communicating with each other over a network. [2] A Real-Time Computing System is the study of hardware and software systems which are subject to a "real-time constraint“.[3]

Real-Time System Design Pattern It’s a reusable solution that can be applied either A Distributed System or A Real-Time System

Active Object 

Intent “Decouples method execution from method invocation to enhance concurrency and simplify synchronized access to an object that resides in its own thread of control. “ [4] This design pattern may also be referred to as Concurrent Object and Actor

Architectural considerations 





Because of the need to respond to timing demands made by different stimuli/responses, the system architecture must allow for fast switching between stimulus handlers. Timing demands of different stimuli are different so a simple sequential loop is not usually adequate. Real-time systems are therefore usually designed as cooperating processes with a real-time executive controlling these processes.

Active Object Design Pattern Example - Restaurant 

Customer -> Client



Waiter -> Proxy

Active Object Design Pattern Example - Restaurant 

Manager -> Scheduler



Order Queue -> Activation Queue

Active Object Design Pattern Example - Restaurant 

Order -> Method Request



Servant -> Chef

Active Object Design Pattern Consequences 

Pro’s • • •



Enhances concurrency Simplifies synchronization Method execution order can differ from invocation order

Con’s

• Performance overhead • Hard to debug

R-T systems design process Design algorithms to process each class of stimulus and response. These must meet the given timing requirements. Design a scheduling system which will ensure that processes arestarted in time to meet their deadlines. Integrate using a real-time operating system. 

Active Object Design Pattern Known Uses CORBA ORBs  ACE Framework  Siemens MedCom  Siemens Call Center management system  Actors 

Monitor Object 

Intent “The Monitor Object pattern synchronizes method execution to ensure only one method runs within an object at a time. It also allows an object’s methods to cooperatively schedule their execution sequences. “ [5] This design pattern may also be referred to as Thread-safe Passive Object.

Monitor Object Design Pattern Pitfalls Calling wait() in unstable state 



Forget to release lock when an exception occurs Not making the method synchronized when needed

Monitor Object Design Pattern Another Example monitor account { int balance := 0 function withdraw(int amount) { if amount < 0 then error "Amount may not be negative" else if balance < amount then error "Insufficient funds" else balance := balance - amount }

}

function deposit(int amount) { if amount < 0 then error "Amount may not be negative" else balance := balance + amount }

Monitor Object Design Pattern Consequences 

Pro’s

• Simplification of concurrency control implementation • Simplify synchronization of methods invoked concurrently on an object • Synchronized methods can cooperatively schedule their order of execution



Con’s

• Concurrency remains complicated • Tightly coupling between object functionality and synchronization mechanisms • Nested monitor lockout • New problems, deadlocks and starvation

Monitor Object Design Pattern Known Uses  

Java Objects ACE Gateway

Conclusion Active Object:  Separates method invocation from method execution. Monitor Object:  Synchronizes method execution to ensure only one method runs within an object at a time.

Thank You

Questions?

Related Documents

Wince Realtime
May 2020 9
Realtime Systems
April 2020 28
Realtime Testcases
November 2019 27
Software Design Issue
July 2020 6

More Documents from ""