Design Patterns for Developing and Using Real-Time CORBA Object Request Brokers
Total Page:16
File Type:pdf, Size:1020Kb
Design Patterns for Developing and Using Real-time CORBA Object Request Brokers Douglas C. Schmidt [email protected] Washington University, St. Louis www.cs.wustl.edu/schmidt/TAO4.ps.gz Sp onsors Bellcore, Bo eing, CDI, DARPA, Ko dak, Lucent, Motorola, NSF, OTI, SAIC, Siemens SCR, Siemens MED, Siemens ZT, and Sprint High-p erformance, Real-time ORBs Douglas C. Schmidt Motivation: the Distributed Software Crisis Symptoms DX IMAGE STORE { Hardware gets smaller, faster, cheap er ATM LAN { Software gets larger, slower, DIAGNOSTIC re exp ensive STATIONS mo Culprits ATM MAN Accidental and inherent CLUSTER { ATM IMAGE y LAN STORE complexit Solutions MODALITIES CENTRAL Middleware, frameworks, (CT, MR, CR) IMAGE { STORE and patterns comp onents, 1 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs Sources of Complexity for Distributed Applications PRINTER Inherent complexity COMPUTER { Latency FILE Reliability CD ROM SYSTEM { { Partitioning (1) STAND-ALONE APPLICATION ARCHITECTURE { Ordering TIME NAME SERVICE CYCLE Accidental Complexity SERVICE SERVICE DISPLAY SERVICE { Low-level APIs FI LE Poor debugging to ols NETWORK SERVICE { Algorithmic PRINT { SERVICE CD ROM decomp osition Continuous re-invention PRINTER FILE SYSTEM { (2) DISTRIBUTED APPLICATION ARCHITECTURE 2 Washington University, St. Louis High-p erformance, Real-time ORBs Douglas C. Schmidt Techniques for Improving Software Quality and Pro ductivity Proven solutions APPLICATION NETWORKING Comp onents SPECIFIC { LOGIC INVOKES MATH ADTS Self-contained, \pluggable" EVENT USER DATA ADTs LOOP INTERFACE BASE { Frameworks (A) CLASS LIBRARY Reusable, \semi-complete" ARCHITECTURE applications NETWORKING USER Patterns MATH { INTERFACE Problem/solution pairs in a APPLICATION CALL INVOKES SPECIFIC BACKS LOGIC EVENT context LOOP Architecture S { ADT DATABASE Families of related patterns (B) APPLICATION FRAMEWORK ARCHITECTURE and comp onents 3 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs Motivation for Real-time Middleware Many applications require TRACKING SATELLITES STATION guarantees PEERS QoS { e.g., telecom, avionics, WWW STATUS INFO Existing middleware do esn't WIDE AREA rt QoS e ectively NETWORK supp o COMMANDS BULK DATA TRANSFER { e.g., CORBA, DCOM, DCE GATEWAY Solutions must be integrated Vertically and horizontally LOCAL AREA NETWORK { GROUND STATION PEERS 4 Washington University, St. Louis High-p erformance, Real-time ORBs Douglas C. Schmidt Candidate Solution: CORBA in args Goals of CORBA CLIENT operation() SERVANT Simplify distribution out args + return value { by automating Object lo cation IDL DSI SKELETON activation IDL and DII ORB OBJECT STUBS INTERFACE ADAPTER Parameter rshaling ORB ma GIOP/IIOP Demultiplexing CORE Error handling STANDARD INTERFACE STANDARD LANGUAGE MAPPING { Provide foundation ORB-SPECIFIC INTERFACE STANDARD PROTOCOL for higher-level rba.html schmidt/co www.cs.wustl.edu/ services 5 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs Limitations of CORBA for Real-time Systems in args Limitations CLIENT operation() SERVANT Lack of QoS out args + return value { sp eci cations Lack of QoS IDL { DSI SKELETON rcement IDL enfo DII ORB OBJECT STUBS INTERFACE ADAPTER { Lack of real-time rogramming ORB p GIOP/IIOP CORE features Lack of p erformance STANDARD INTERFACE STANDARD LANGUAGE { MAPPING optimizations ORB-SPECIFIC INTERFACE STANDARD PROTOCOL www.cs.wustl.edu/schmidt/ORB- endsystem.ps.gz 6 Washington University, St. Louis High-p erformance, Real-time ORBs Douglas C. Schmidt The ACE ORB TAO TAO Overview in args operation() CLIENT SERVANT A high-p erformance, out args + return value { real-time ORB Telecom and RIDL SKELETON fo cus REAL-TIME avionics RIDL ORB QOS OBJECT STUBS INTERFACE Leverages the ACE ADAPTER { framework REAL-REAL-TIMETIME Runs on RTOSs, RIOP ORB CORE POSIX, and Win32 OS KERNEL OS KERNEL REAL-TIME I/O REAL-TIME I/O Related work SUBSYSTEM SUBSYSTEM HIGH-SPEED HIGH-SPEED QuO at BBN NETWORK ADAPTERS NETWORK NETWORK ADAPTERS { { ARMADA at U. AO.html schmidt/T www.cs.wustl.edu/ Mich. 7 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs The ADAPTIVE Communication Environment ACE SELF-CONTAINED MIDDLEWARE ACE Overview DISTRIBUTED JAWS ADAPTIVE APPLICATIONS SERVICE WEB SERVER THE ACE ORB Concurrent OO COMPONENTS TOKEN GATEWAY { SERVER SERVER (TAO) networking LOGGING NAME TIME SERVER SERVER SERVER framework SERVICE CORBA Ported to C++ FRAMEWORKS ACCEPTOR CONNECTOR { HANDLER HANDLER Java ADAPTIVE SERVICE EXECUTIVE (ASX) and PROCESS/ Runs on RTOSs, C++ THREAD LOG SERVICE SHARED { MANAGERS MSG CONFIG- MALLOC WRAPPERS REACTOR/ URATOR and PROACTOR POSIX, SYNCH SPIPE SOCK_SAP/ FIFO MEM SYSV WRAPPERS SAP TLI_SAP SAP MAP WRAPPERS OS ADAPTATION LAYER Win32 C PROCESSES/ STREAM SOCKETS/ NAMED SELECT/ DYNAMIC MEMORY SYSTEM APIS THREADS PIPES TLI PIPES IO COMP LINKING MAPPING V IPC Related work PROCESS/THREAD COMMUNICATION VIRTUAL MEMORY SUBSYSTEM SUBSYSTEM SUBSYSTEM { x-Kernel GENERAL POSIX AND WIN32 SERVICES { SysV STREAMS www.cs.wustl.edu/schmidt/ACE.html 8 Washington University, St. Louis High-p erformance, Real-time ORBs Douglas C. Schmidt ACE Statistics ACE contain > 125,000 lines of C++ Currently used by dozens of companies { Over 10 p erson-years of e ort { Bellcore, Bo eing, Ported to UNIX, Win32, MVS, and Ericsson, Ko dak, emb edded platforms Lucent, Motorola, SAIC, Siemens, { e.g., VxWorks, Chorus, LynxOS, StorTek, etc. pSoS Supp orted commercially Large user community { www.riverace.com CE- schmidt/A { www.cs.wustl.edu/ users.html 9 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs Applying ORBs to Real-time Avionics Domain Challenges HUD Air Nav Frame { Perio dic 3:PUSH (DEMARSHALED DATA) deterministic deadlines EVENT real-time CHANNEL { COTS infrastructure { Op en systems 2:PUSH (EVENTS) Sensor Sensor Sensor proxy proxy proxy OBJECT REQUEST BROKER 1: SENSORS GENERATE DATA 10 Washington University, St. Louis High-p erformance, Real-time ORBs Douglas C. Schmidt Visualizing Perio ds for Avionics Op erations 11 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs Real-time Features and Optimizations in TAO in args operation() PRESENTATION CLIENT SERVANT LAYER out args + return value OPTIMIZATIONS DATA COPYING OPTIMIZATIONS IDL REQUEST SKELETON DEMUXING AND IDL ORB OBJECT DISPATCHING STUBS INTERFACE ADAPTER OPTIMIZATIONS THREADING ORB OPTIMIZATIONS CORE GIOP PROTOCOL OS KERNEL OS KERNEL OPTIMIZATIONS CONNECTION I/O SUBSYSTEM MANAGEMENT OS I/O SUBSYSTEM OS I/O SUBSYSTEM OPTIMIZATIONS OPTIMIZATIONS NETWORK ADAPTERS NETWORK ADAPTERS NETWORK NETWORK ADAPTER OPTIMIZATIONS 12 Washington University, St. Louis High-p erformance, Real-time ORBs Douglas C. Schmidt Providing QoS to CORBA Op erations Design Challenges PERIODIC SCHEDULING AND DISPATCHING P TIME { Sp ecifying/enforcing QoS requirements C C { Fo cus on Op erations up on Objects TTT T+PTPT+2P Rather than on communication P: PERIOD C: REQUEST COMPUTATION TIME channels or threads/synchronization Initial fo cus RT Operation { Determinisitic deadlines struct RT_Info Static scheduling { { Time_t worstcase_exec_time_; Time_t cached_exec_time_; Solution approach Period_t period_; Importance importance_; sequence<RT_Info> dependencies_; { Servants publish resource e.g., CPU }; deadlines and p erio dic requirements { Most clients are also servants 13 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs TAO's Real-time Scheduling Service Comp onents struct RT_Info { OFF-LINE 3: POPULATE SCHEDULER wc_exec_time_; RT_INFO cached_exec_time_; REPOSITORY Oine period_; { importance_; Assess schedule RT_INFO dependencies_; REPOSITORY }; feasibility 4: ASSESS 1: CONSTRUCT CALL Assign thread and SCHEDULABILITY CHAINS OF RT_OPERATIONS DEPENDS UPON = 5: ASSIGN OS THREAD 2: IDENTIFY THREADS EXECUTES AFTER PRIORITIES AND queue priorities DISPATCH QUEUE RT RT RT ORDERING Online 6: SUPPLY { Operation Operation Operation RUN-TIME PRIORITIES SUBPRIORITIES SCHEDULER Supply priorities to OBJECT ADAPTER TO ORB ORB CORE Priority/ MODE 0 endsystem Subpriority ORB MODE 1 Table Per Mode CURRENT MODE 2 via O 1 MODE dispatcher MODE 3 SELECTOR I/O SUBSYSTEM table lo okup www.cs.wustl.edu /sc hm idt /T AO. ps .gz 14 Washington University, St. Louis High-p erformance, Real-time ORBs Douglas C. Schmidt TAO's Real-time ORB Endsystem Architecture U Solution Approach R CLIENTS SERVANTS Z U STUBS SKELETONS Integrate RT dispatcher into E { N SERVANT DEMUXER R endsystem T QoQoSS ORB O I API OBJECT Supp ort multiple request C { M ADAPTER O strategies E scheduling ORB CORE P e.g., RMS, RMS with Y S C Preemption, and REACTOR REACTOR REACTOR REACTOR B Deferred H (20 HZ)HZ) (10 HZ)HZ) (5 HZ)HZ) (1 HZ)HZ) U E EDF F D Requests ordered across F { U E priorities by OS L SOCKET QUEUE DEMUXER thread I/I/OO R E SUBSYSTEM S dispatcher R { Requests ordered within ATM PORT INTERFACE riorities based on data CONTROLLER (APIC) p and imp ortance dep endencies 15 y, St. Louis Universit Washington Douglas C. Schmidt High-p erformance, Real-time ORBs Priority Inversion Exp eriments One high priority client Servants SCHEDULER RUNTIME Object Adapter 1..n low priority clients ... C 0 C 1 ... C n Server factory implements ORB Core Requests thread-p er-rate I/O SUBSYSTEM Highest real-time Client Server { priority for high priority client Lowest real-time ATM Switch { riority