Architectural pattern: Reactor Source: POSA II pp 179 – 214POSA II Environment: an application that receives multiple requests simultaneously but may process.

Slides:



Advertisements
Similar presentations
MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
Advertisements

Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Multithreaded Programming.
Threads. Objectives To introduce the notion of a thread — a fundamental unit of CPU utilization that forms the basis of multithreaded computer systems.
Threads.
Broker Pattern Pattern-Oriented Software Architecture (POSA 1)
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Chapter 4: Threads Overview Multithreading.
A brief look at CORBA. What is CORBA Common Object Request Broker Architecture developed by OMG Combine benefits of OO and distributed computing Distributed.
Seyed Mohammad Ghaffarian ( ) Computer Engineering Department Amirkabir University of Technology Fall 2010.
Adaptive Database Application Modeling API Final Project Report SOURENA NASIRIAMINI CS 491 6/2/2005.
Software Engineering I Object-Oriented Design Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Software Patterns - F04 Asynchronous Completion Token 1.
Chapter 4: Threads READ 4.1 & 4.2 NOT RESPONSIBLE FOR 4.3 &
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 4: Threads Overview Multithreading Models Threading Issues.
 1. Introduction  2. Development Life-Cycle  3. Current Component Technologies  4. Component Quality Assurance  5. Advantages and Disadvantages.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 4: Threads.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Chapter 4: Multithreaded Programming. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 4: Multithreaded Programming Overview.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 4 Operating Systems.
Chapter 4: Threads. 4.2 Chapter 4: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Chapter 4: Threads.
Silberschatz, Galvin and Gagne ©2011Operating System Concepts Essentials – 8 th Edition Chapter 4: Threads.
Pattern Oriented Software Architecture for Networked Objects Based on the book By Douglas Schmidt Michael Stal Hans Roehnert Frank Buschmann.
Abstract Factory Design Pattern making abstract things.
Track 1: Summary Slides for POSA2 Patterns and Frameworks Distributed Real-Time Systems (TI-DRTS) Version:
E81 CSE 532S: Advanced Multi-Paradigm Software Development Venkita Subramonian, Christopher Gill, Guandong Wang, Zhenning Hu, Zhenghui Xie Department of.
Proactor Pattern Venkita Subramonian & Christopher Gill
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Explore Patterns in Context-Aware Applications --Using Reactor Pattern to Develop In/Out Board Fall 2002 Yu Du.
Architectural pattern: Interceptor Source: POSA II pp 109 – 140POSA II Environment: developing frameworks that can be extended transparently Recurring.
Threaded Programming in Python Adapted from Fundamentals of Python: From First Programs Through Data Structures CPE 401 / 601 Computer Network Systems.
Update on CORBA Support for Babel RMI Nanbor Wang and Roopa Pundaleeka Tech-X Corporation Boulder, CO Funded by DOE OASCR SBIR.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
Events in General. Agenda Post/wait technique I/O multiplexing Asynchronous I/O Signal-driven I/O Database events Publish/subscribe model Local vs. distributed.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Interceptor CS562 Spring 2002 Jan Anand Krishnan Morgan Deters Venkita Subramonian.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Venkita Subramonian, Christopher Gill, Ying Huang, Marc Sentany Department of Computer Science.
CS533 - Concepts of Operating Systems 1 Threads, Events, and Reactive Objects - Alan West.
Channels. Models for Communications Synchronous communications – E.g. Telephone call Asynchronous communications – E.g. .
Contents 1.Overview 2.Multithreading Model 3.Thread Libraries 4.Threading Issues 5.Operating-system Example 2 OS Lab Sun Suk Kim.
High degree of user interaction Interactive Systems: Model View Controller Presentation-abstraction-control.
Software Design Refinement Using Design Patterns
OPERATING SYSTEM CONCEPT AND PRACTISE
Chapter 4: Threads.
Threaded Programming in Python
Event Handling Patterns Asynchronous Completion Token
Instructor: Dr. Hany H. Ammar
Nadeem MajeedChoudhary.
Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4: Threads.
OPERATING SYSTEMS Threads
Modified by H. Schulzrinne 02/15/10 Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4: Threads.
Channels.
Chapter 4: Threads.
Channels.
Channels.
Chapter 4: Threads.
Chapter 4: Threads.
Chapter 4: Threads.
The reactor design pattern
Chapter 4:Threads Book: Operating System Principles , 9th Edition , Abraham Silberschatz, Peter Baer Galvin, Greg Gagne.
Message Passing Systems
Presentation transcript:

Architectural pattern: Reactor Source: POSA II pp 179 – 214POSA II Environment: an application that receives multiple requests simultaneously but may process them synchronously and serially Problem: –Application cannot block, waiting for requests from one client and starve the others –Application cannot afford thread-per-client

(Core of a) solution - reactors Event handler knows how to process events (such as session start, service request) related to the application. Event handlers register with the Reactor. Reactor manages registered event handlers and handles (operating-system supplied handles). When an event arrives, the Reactor dispatches it to the appropriate event handler. Synchronous event demultiplexer waits for events to occur, and notifies the Reactor when there are events ready for processing. Examples: select() in UNIX, WaitForMultipleObjects() in Win32.

Dynamics 1.Application registers concrete event handlers and the type of events each should handle with the Reactor. 2.Application invokes the Reactor’s handle_events() method, which starts the “event loop” 3.Reactor calls the synchronous event demultiplexer. 4.When events are available, demultiplexer returns to the Reactor. 5.Reactor determines the appropriate event handler and dispatches the event to it. 6.Event handler does the work. 7.Reactor continues at step 3.

Implementation 1.Define the event handler interface Dispatch to objects or functions? Single method or method-per-event-type? 2.Define the reactor interface Does the event source come from the handler or the registration call? 3.Implement the reactor Includes picking the demultiplexer 4.Determine the number of reactors required 5.Implement the concrete event handlers Includes deciding how to maintain state when needed

Known uses InterViews Xt toolkit ACE Reactor Framework Several CORBA ORB Core implementations Call Center management Non-software: receiving phone calls

Consequences Benefits –Separation of concerns –Modularity, reusability, configurability –Portability –Concurrency control (coarse grained) Liabilities –Restricted applicability (requires select() or equivalent) –Non-preemptive –Complexity in testing and debugging