C++ Network Programming with Patterns, Frameworks, And

C++ Network Programming with Patterns, Frameworks, And

C++ Network Programming with Patterns, Advanced ACE Tutorial Douglas C. Schmidt Frameworks, and ACE Roadmap to Levels of Middleware Douglas C. Schmidt APPLICATIONS Observations HUD AVIONICS – Historically, apps Professor Department of EECS DOMAIN-SPECIFIC MIDDLEWARE SERVICES WTS REPLICATION [email protected] Vanderbilt University Nav SERVICE built atop OS Cons EVENT Cons COMMON MIDDLEWARE SERVICES CHANNEL – Today, apps built www.cs.wustl.edu/ schmidt/ (615) 343-8197 Cons atop middleware DISTRIBUTION MIDDLEWARE – Middleware has multiple layers HOST INFRASTRUCTURE MIDDLEWARE Just like network Sponsors OPERATING SYSTEMS & PROTOCOLS protocol stacks NSF, DARPA, ATD, BBN, Boeing, Cisco, Comverse, GDIS, Experian, Global MT, HARDWARE DEVICES Hughes, Kodak, Krones, Lockheed, Lucent, Microsoft, Mitre, Motorola, NASA, Nokia, Nortel, OCI, Oresis, OTI, QNX, Raytheon, SAIC, Siemens SCR, Siemens MED, www.cs.wustl.edu/˜schmidt/PDF/ Siemens ZT, Sprint, Telcordia, USENIX middleware-chapter.pdf Vanderbilt University 1 Advanced ACE Tutorial Douglas C. Schmidt Advanced ACE Tutorial Douglas C. Schmidt Motivation for Concurrency Motivation for Distribution PRINTER SERVER Collaboration ! connectivity and maxfdp1 Leverage hardware/software COMPUTER interworking read_fds CLIENT WORK FILE SYSTEM REQUEST – e.g., multi-processors and OS CD ROM Performance ! multi-processing thread support WORK WORK WORK and locality REQUEST REQUEST CLIENT REQUEST (1) STAND-ALONE APPLICATION ARCHITECTURE CLIENT CLIENT Increase performance Reliability and availability ! TIME NAME CYCLE (1) ITERATIVE SERVER SERVICE replication – e.g., overlap computation and SERVICE SERVICE DISPLAY communication ! SERVER SERVICE Scalability and portability FI LE modularity Improve response-time NETWORK SERVICE CLIENT WORK ! PRINT Extensibility dynamic REQUEST – e.g., GUIs and network servers SERVICE configuration and reconfiguration WORK WORK WORK CD ROM CLIENT REQUEST REQUEST REQUEST Simplify program structure CLIENT CLIENT PRINTER FILE SYSTEM Cost effectiveness ! open – e.g., sync vs. async (2) DISTRIBUTED APPLICATION ARCHITECTURE systems and resource sharing (2) CONCURRENT SERVER Vanderbilt University 2 Vanderbilt University 3 Advanced ACE Tutorial Douglas C. Schmidt Advanced ACE Tutorial Douglas C. Schmidt Challenges and Solutions Caveats Developing efficient, robust, and extensible concurrent networking OO is not a panacea applications is hard – Though when used properly it helps minimize “accidental” – e.g., must address complex topics that are less problematic or not complexity and improve software quality factors relevant for non-concurrent, stand-alone applications It’s also essential to understand advanced OS features to enhance OO techniques and OO language features help to enhance software functionality and performance, e.g., quality factors – Multi-threading – Key OO techniques include patterns and frameworks – Multi-processing – Key OO language features include classes, inheritance, dynamic – Synchronization binding, and parameterized types – Shared memory – Key software quality factors include modularity, extensibility, – Explicit dynamic linking portability, reusability, and correctness – Communication protocols and IPC mechanisms Vanderbilt University 4 Vanderbilt University 5 Advanced ACE Tutorial Douglas C. Schmidt Advanced ACE Tutorial Douglas C. Schmidt Tutorial Outline Software Development Environment Brief overview of key OO networking and concurrency concepts and The topics discussed here are largely independent of OS, network, OS platform mechanisms and programming language – Emphasis is on practical solutions – Currently used successfully on UNIX/POSIX, Windows, and RTOS platforms, running on TCP/IP networks using C++ Examine a range of examples in detail Examples are illustrated using freely available ADAPTIVE – Networked Logging Service Communication Environment (ACE) OO framework components – Concurrent Web Server – Application-level Telecom Gateway – Although ACE is written in C++, the principles covered in this – Call Center Manager Event Server tutorial apply to other OO languages Discuss general concurrent programming strategies – e.g., Java, Eiffel, Smalltalk, etc. Provide URLs for further reading on the topic In addition, other networks and backplanes can be used, as well Vanderbilt University 6 Vanderbilt University 7 Advanced ACE Tutorial Douglas C. Schmidt Advanced ACE Tutorial Douglas C. Schmidt Sources of Complexity Sources of Inherent Complexity PRINTER Inherent complexity Inherent complexity results from fundamental domain challenges, COMPUTER – Latency e.g.: FILE CD ROM SYSTEM – Reliability – Synchronization Concurrent programming Distributed programming (1) STAND-ALONE APPLICATION ARCHITECTURE – Deadlock Eliminating “race conditions” Addressing the impact of latency TIME NAME SERVICE CYCLE SERVICE SERVICE Accidental Complexity Deadlock avoidance Fault tolerance and high availability DISPLAY SERVICE – Low-level APIs FI LE Fair scheduling Load balancing and service NETWORK SERVICE – Poor debugging tools partitioning PRINT – Algorithmic Performance optimization SERVICE and tuning Consistent ordering of distributed CD ROM decomposition events PRINTER FILE SYSTEM – Continuous (2) DISTRIBUTED APPLICATION ARCHITECTURE re-invention Vanderbilt University 8 Vanderbilt University 9 Advanced ACE Tutorial Douglas C. Schmidt Advanced ACE Tutorial Douglas C. Schmidt Sources of Accidental Complexity OO Contributions to Concurrent Accidental complexity results from limitations with tools and techniques and Distributed Applications used to develop concurrent applications, e.g., Concurrent network programming is Patterns and frameworks elevate traditionally performed using development level to focus on Lack of portable, reentrant, type-safe and extensible system call low-level OS mechanisms, e.g., application concerns, e.g., interfaces and component libraries fork/exec Service functionality and Inadequate debugging support and lack of concurrent and policies distributed program analysis tools Shared memory and semaphores Service configuration Widespread use of algorithmic decomposition Memory-mapped files – Fine for explaining concurrent programming concepts and Concurrent event Signals algorithms but inadequate for developing large-scale concurrent demultiplexing and event network applications sockets/select handler dispatching Continuous rediscovery and reinvention of core concepts and Low-level thread APIs Service concurrency and components synchronization Vanderbilt University 10 Vanderbilt University 11 Do Advanced ACE Tutorial Douglas C. Schmidt Overview of Patterns SERVER Patterns represent solutions to problems that arise when developing software within a particular context FORWARD REQUEST FORWARD – i.e., “Patterns == problem/solution pairs within a context” 2: Patterns capture the static and dynamic structure and collaboration QUOTER : PROXY among key participants in software designs QUOTER : – They are particularly useful for articulating how and why to RESPONSE resolve non-functional forces 3: METHOD CALL 1: Patterns facilitate reuse of successful software architectures and designs NETWORK METHOD RETURN Example: the Proxy Pattern BROKER : 4: : Provide a surrogate for another object that CLIENT Intent controls access to it Vanderbilt University Vanderbilt University 12 Advanced ACE Tutorial Advanced ACE Tutorial Douglas C. Schmidt Advanced ACE Tutorial Douglas C. Schmidt Overview of Frameworks and Components Class Libraries versus Frameworks APPLICATION- LOCAL MATH SPECIFIC INVOCATIONS CLASSES Key distinctions FUNCTIONALITY A framework is: ADT CLASSES DATABASE Class libraries – “An integrated collection of components that collaborate to CLASSES GUI GLUE NETWORK – Reusable building blocks produce a reusable architecture for a family of related applications” EVENT CLASSES LOOP CODE IPC CLASSES – Domain-independent Frameworks differ from conventional class libraries: (A) CLASS LIBRARY ARCHITECTURE – Limited in scope – Passive 1. Frameworks are “semi-complete” applications NETWORKING EVENT LOOP 2. Frameworks address a particular application domain ADT Frameworks 3. Frameworks provide “inversion of control” CLASSES GUI APPLICATION- CALL – Reusable, “semi-complete” INVOKES SPECIFIC BACKS Frameworks facilitate reuse of successful networked application FUNCTIONALITY EVENT applications MATH LOOP software designs and implementations CLASSES – Domain-specific DATABASE EVENT – Broader in scope – Applications inherit from and instantiate framework components LOOP (B) FRAMEWORK ARCHITECTURE – Active Vanderbilt University 14 Vanderbilt University 15 Advanced ACE Tutorial Douglas C. Schmidt Advanced ACE Tutorial Douglas C. Schmidt The ADAPTIVE Communication Environment (ACE) ACE Statistics JAWS ADAPTIVE NETWORKED STANDARDS-BASED MIDDLEWARE WEB SERVER SERVICE THE ACE ORB TOKEN GATEWAY (TAO) COMPONENTS SERVER SERVER LAYER ACE library contains 250,000 Currently used by LOGGING NAME TIME SERVER SERVER SERVER lines of C++ dozens of companies SERVICE CORBA FRAMEWORK ACCEPTOR CONNECTOR HANDLER HANDLER – Over 40 person-years of effort – Bellcore, BBN, LAYER Boeing, Ericsson, / C++ PROCESS STREAMS Ported to UNIX, Windows, MVS, and THREAD LOG SERVICE SHARED Hughes, Kodak, WRAPPER MANAGERS MSG CONFIG- MALLOC RT/embedded platforms FACADE REACTOR/ PROACTOR URATOR Lockheed, Lucent, LAYER SYNCH SPIPE SOCK SAP/ FIFO MEM FILE WRAPPERS SAP TLI SAP SAP MAP SAP – e.g., VxWorks, LynxOS, Chorus Motorola, Nokia, OS ADAPTATION

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    77 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us