Docstoc

Enhancing Real-time CORBA via Real-time Java - Distributed

Document Sample
Enhancing Real-time CORBA via Real-time Java - Distributed Powered By Docstoc
					             Enhancing Real-time CORBA
              via Real-time Java features
     Arvind S. Krishna
    Douglas C. Schmidt                  Raymond Klefstad
                                        Elec & Comp. Eng. Dept
    Elec & Comp. Eng. Dept
                                   University of California, Irvine
      Vanderbilt University
                                            klefstad@uci.edu
{arvindk, schmidt}@dre.vanderbilt.edu

 International Conference on Distributed Computer Systems
                        Tokyo, Japan
                   Friday, March 19, 2004
Talk Outline

− Tech transitions in the DRE domain  Real-time
  middleware & Real-time Java
− RT-Java + real-time middleware  ZEN project
− ZEN R&D process
    −   Design & Architecture
    −   Applying Real-time Java features
    −   Empirical Results
−   Concluding remarks and References
                   DRE Domain: Characteristics
                                                    Total Ship Computing Environments
Types
 • Wide applicability
                                                                       Total Ship C&C Center




      • Range from Total ship-board computing
        systems to Industrial process control
        systems
 • Common Requirement
      • Right answer delivered too late becomes
        wrong answer
Characteristics and Requirements
 • Distributed Systems require                      Industrial Process Control
     capabilities to manage connections and
     message transfer between separate
     machines
 •   Real-time Systems  require
     predictable and efficient control over end-
     to-end system resources
 •   Embedded Systems  have weight,
     cost, and power constraints that limit their
     computing and memory resources

Increasingly DRE applications are combined to form “systems of systems”
          Current Real-time Middleware Trends
• Current Real-time CORBA ORBs are          The scheduling of Java threads is
 developed in C and C++
                                             purposely under-specified (so to allow
  – ACE+TAO from ISIS Vanderbilt
                                             easy implementation of JVM on as many
  – ORBexpress from OIC
                                             platform as possible)
  – eORB from Prism Technologies
• Real-time CORBA has not been
                                           The GC can preempt for unbounded
 universally adopted by DRE application     amount of time Java Threads
 developers                                Java provides coarse-grained control
  – Complexity of the CORBA C++             over memory allocation, and it does not
    mapping                                 provide access to raw memory
  – Steep learning curve caused by         Java does not provide high resolution
    feature rich and complex C++            time, nor access to signals, e.g. POSIX
    language
                                            Signals
• Increasingly hard to find “good” C++
 application developers and retain them   The Real-Time Specification for Java (RTSJ)
                                          extends Java in the following areas:
Java Programming Language has emerged
                                           • New memory management models that can
having less complexity than C++              be used in lieu of garbage collection
     – Safety
                                           • Stronger semantics on thread and their
     – Simplicity
                                             scheduling
     – Productivity
However, Java is not suitable for          • Access to physical memory
developing DRE applications:               • Asynchronous Event handling mechanism
                                           • Timers and Higher time resolution
                                           • Priority pre-emptive scheduler
                  RTSJ Thread & Memory Models




Scoped Memory                                         RTSJ Thread Model
Region based memory based tied to number of           Real-time Threads – priority and
active threads in that region                          scheduling characteristics specified
Properties                                            NoHeapRealtimeThreads
Any thread may create a scoped region – using new       • Do not “touch” the heap
operator                                                • Use of NHRT threads can have
However, only a real-time thread may allocated from
that region                                               exec eligibility higher than that of
                                                          GC
Immortal Memory
                                                      Physical Memory
  • Same lifetime as the JVM
  • Objects allocated never garbage                    • Allows access to specific locations
   collected                                             based on addresses.
                   Scoped Memory in Action


                            Obj A
                            created in
                            Heap region




              Heap




                                             time
(new RealtimeThread(…))
.start()             new A(…)
                  Scoped Memory in Action

                                                                 Scoped Memory
                                            Ma1 is an “inner     Properties
                     Note: ma1 is           scope”               • Reference counted; no of active threads
                     reference is           can hold             in region
                     in heap,               references only      • When reference count of a region drops
                                            to “outer regions”   to zero
                                                                    – All Objects within that region
                                                                      are considered unreachable
                                      <LTMemory>                    – Finalizers of all objects run;
                                                                                    Logic instance of
                                                                 Assignment Rules Runnable
              Heap                      ma1                                            ma1  ref to obj
                                                                  • obj in region ma can hold Current in
                                      Reference count = 1          region mb if        Allocation Context
                                      Reference count = 0            lifetime (ma) <= lifetime (heap)

                                                                           logic1

                                                                                           time
(new RealtimeThread(…))
.start()                                        ma1.enter(logic1)

                                    ma1 = new LTMemory(…)
Talk Outline

Tech transitions in the DRE domain  Real-time
  middleware & Real-time Java
− RT-Java + real-time middleware  ZEN project
    −   Design & Architecture
    −   Applying Real-time Java features
    −   Empirical Results
−   Concluding remarks and References
       Motivation for ZEN Real-time ORB
Integrate best aspects of several key technologies
    • Java: Simple, less error-prone, large user-base
    • Real-time Java: Real-time support
    • CORBA: Standards-based distributed
       applications
    • Real-time CORBA: CORBA with Real-time
       QoS capabilities


ZEN project goals
   • Make development of distributed, real-time, &
      embedded (DRE) systems easier, faster, &
      more portable
   • Provide open-source Real-time CORBA ORB
      written in Real-time Java to enhance
      international middleware R&D efforts
        Phase I – Applying Opt Strategies
• Foot-print Reduction Optimization
  • Micro ORB Architecture  Virtual
    Component Pattern
  • Micro POA Architecture  Pluggable
    components

• Request Demux/Dispatch
  Optimizations
  • Connection Management 
    Acceptor-Connector pattern, Reactor
    (java’s nio package)
  • Buffer Management Strategies
  • Request Demultiplexing  Active
    Demultiplexing & Perfect Hashing

• POA Optimizations
  • Object Key Processing Strategies 
    Asynchronous completion token                       RT-CORBA
    pattern                                             Thread Pool


  • Servant lookup  Reverse lookup
    map
  • Concurrency Strategies  Half-                   Object Adapter
    Sync/Half-Async
                                          ORB CORE
                             Phase II – Applying RTSJ
Phase I  Optimization patterns and                       Phase II  Enhance Predictability by applying
principles
 • ORB-Core Optimizations                                  RTSJ features
   •   Micro ORB Architecture  Virtual Component
       Pattern                                             • Associate Scoped Memory with Key ORB
   •   Connection Management  Acceptor-Connector            Components
       pattern, Reactor (java’s nio package)
   •   Collocation and Buffer Management Strategies           – I/O Layer : Acceptor-Connector, Transports
 • POA Optimizations                                          – ORB Layer: CDR Streams, Message Parsers
   •   Request Demultiplexing  Active Demultiplexing &
       Perfect Hashing                                        – POA Layer: Thread-Pools and Upcall Objects
   •   Object Key Processing Strategies  Asynchronous

   •
       completion token pattern
       Servant lookup  Reverse lookup map
                                                           • Using NoHeapRealtimeThreads
   •   Concurrency Strategies  Half-Sync/Half-Async          – Ultimately use NHRT Threads for
                                                                request/response processing
                                                              – Reduce priority inversions from Garbage
                                                                Collector




                                                                 Phase III  Build a Real-Time CORBA
                                                                 ORB that runs atop a mature RTSJ
                                                                 Layer
Talk Outline

– Tech transitions in the DRE domain  Real-time
  middleware & Real-time Java
− RT-Java + real-time middleware  ZEN project
    −   Design & Architecture
    −   Applying Real-time Java features
    −   Empirical Results
    −   Open challenges
−   Concluding remarks and References
        Applying RTSJ features – Motivation
Original design of ZEN
  • All components allocated in heap
  • Request processing thread may be
     preempted by GC (demand garbage
     collection)

Goals
  • Compliance with CORBA specification
  • Interoperability with classic CORBA
  • Reduce overhead for applications not using
    real-time features
  • End-user transparent

Design of ZEN for Real-Time CORBA
 • Apply scoped memory along critical request
   processing path
 • Provide Policies at the POA level for RTSJ
   aware users
    • Allows NHRT threads used for request
      processing
    • Proper use of NHRT threads would minimize GC
      execution during request processing
          Analyzing Request Processing Steps
                                                                                Server ORB
Server Side Connection Acceptance                                   13



4. An acceptor accepts the new incoming connection.                   Independent
                                                                                Object Adapter


6. A new connection handler T1 is created to service              Steps for two different
                                                                         GIOP

                                                              clients do not share context
                                                                        Message

    requests
                                                                                         11, 14
                                                                                                            5
                                                                        Parsers
                                                                  1.0     1.1     1.0


7. The Transport's event loop waits for data events from          Buffer Manager
                                                                                                   Connection
                                                                                                     Cache


    the client
                                                                                                       C1
                                                                                           12                   C3
                                                                                                       C2



Server Side Request Processing Steps                              Acceptor        4     Transport T1
                                                                                                        6, 7,14



11. The request header on connection is read to
   determine the size of the request.                           Repetitive & Ephemeral
                                                                Carried out for each
12. A buffer of the corresponding size is obtained from the
                                                                client request
   buffer manager to hold request and read data.                Typically objects live for
13. The request is the demultiplexed to obtain the target       one cycle
   POA, servant, and skeleton servicing the request. The
   upcall is dispatched to the servant after demarshaling
   the request.                                                           Thread Bound
14. The reply is marshaled using the corresponding GIOP
                                                                 Steps executed by
   message writer; Transport sends reply to the client.
                                                                 I/O threads Thread-
                                                                 Pool threads
        Application of Scoped Memory – ZEN
Ephemeral                               Create all objects in a scoped region
                             • Two requests can be mapped to two
Independent                    separate scope regions
                             • Temporary objects may be cleared after
                               request processing
Threadbound                             • Encapsulate steps as “logic” class
                                          associate this logic class with real-time
                                          threads
Applying Scoped Memory                  • Threads enter the scoped region;
1.Break Steps into three broad            processes request; exits region enabling
  regions based on request                objects to be finalized
  processing steps                                             I/O SPACE




                                                                                             ER
   I/O scope  read request




                                                                                           UT
                                                                                                    I/O




                                                                                          O
                                                NE




                                                                                        
                                                           ORB SPACE                              SPACE

   ORB scope  process request


                                                  ST




                                                                                     ER
                                                    ED




                                                                                   NN
                                                     SC




                                                                                 :I
                                                                               ES
   POA scope  perform upcall send
                                                           POA SPACE




                                                        OP




                                                                              C
                                                                           EN
                                                          ES




                                                                          R
                                                                        FE
      reply




                                                                      RE
                                                                                                   ORB
                                                                                                  SPACE
2.Recursively enter each space from
  I/O  POA scopes
3.Implicitly exit regions from POA 
                                                     ()




                                                                              ex
                                                     r
                                                  te




                                                                                it
                                                en



                                                                                                   POA

  I/O scope                                                                                       SPACE
              Scope Memory in ZEN: Action

         Associate a
         start scope                                                       POA Scope
         with real-time
         thread


  1: (new RealtimeThread(default Scope))
                                             ORB Scope                  The three scopes are
                                                                        created during ORB
                                                                        initialization time
              I/O Scope      I/O Scope is
                             now current
                             active
                             region

                          2: (I/O Scope).enter()

                                                                                   time
3: waitForData()


I/O thread
waits for
                                              NETWORK
data


                                            Following Slides are adapted from Angelo Corsaro
                I/O Stage Processing
                        I/O Scope
                        • Participants The participants for this phase include,
                          acceptors, and transports
       The message
       is created       • RTSJ application
       within the
       scoped region       –Each of these components are thread-bound components
                            and are designed based on inner logic class
                               –   Corresponds to the logic run by the thread
                           –Instead of creating the entire component in scoped memory,
                            we create the inner logic class in a scoped memory region,
I/O Scope
                            mio
                           –This logic class is associated with the thread at creation time

                                     3:Create new Message
                       new GIOPMessage ()

                2:Read Data                                                     time



                                     NETWORK
    1:Data
    arrival
                 ORB Stage processing
                                                        ORB Scope
     The thread           Nested inner
     enters ORB           scope: all      Scope Stack • Participants Message parsers,
     scope to parse       refs from ORB                 CDR Streams
     request              -> I/O are          I/O
                          valid              Scope    • RTSJ application
                                                         –The appropriate message
                                                          parser associated to parse
                           ORB Scope                      request
                                              ORB
                                              Scope      –The message parser and
                                                          buffer created in a nested
I/O Scope
                                                          memory region, morb.
                                                         –Using RTSJ memory rules,
                                                          references from the ORB to
                             parseAndProcessRequest()     the I/O space are valid
              new GIOPMessage ()
                                               time


                  NETWORK
                    POA Stage processing
  Enter POA scope
                                           Scope Stack
                                                         Steps
  to process
  request and                                            • Demux request to get target
  send response
                         POA Scope              I/O        POA, servant and skeleton
                                               Scope     • Perform upcall on the servant
                                                           marshal reply back to client

                          Up-call
                                               ORB
                                                         RTSJ Application
                          related                        • Message parser – parses the
                          objects              Scope
        ORB Scope         created in                       request to find target servant
                          this scope                       and skeleton
                                                         • Set up context for the upcall
                                                POA      • Upcall Object – holds info
                                               Scope       necessary to perform upcall
I/O Scope
                                       performUpCall()
                                                         • Output buffer – holds response
                             parseAndProcessRequest()
              new GIOPMessage ()
                                               time


                    NETWORK
Talk Outline

– Tech transitions in the DRE domain  Real-time
  middleware & Real-time Java
− RT-Java + real-time middleware  ZEN project
    −   Design & Architecture
    −   Applying Real-time Java features
    −   Empirical Results
    −   Open challenges
−   Concluding remarks and References
              Predictability Enhancement
Overview
• POA Demultiplexing experiment
  conducted to measure improvement
  in predictability
Result Synopsis
 •Average Measures:
  • Scoped Memory does have
    some overhead ~ 3 s
•Dispersion Measures:
  • Considerable improvement in
    predictability
  • Dispersion improves by a ~
    factor of 4
• Worst-Case Measures:
  • Scoped memory bounds             Associating scoped memory
    worst case                       – Does not compromise performance
  • Heap shows marked                – Significantly enhances predictability
    variability                      – Bounds worst case latency
                             Enter Exit Analysis
Overview
• Quantify overhead incurred by
 using Scope Memory:
  • enter () – entering scope region
  • exit () – leave the scope region
Result Synopsis
 •Average Measures:
  • Constant enter () time across all
    message sizes.
  • exit () time increases with
    message size
•Dispersion Measures:
  • exit () methods incur
    considerable variability when
    compared to enter ()                On exit finalizers of objects run, hence larger
•Worst-Case Measures:                   messages have higher average latency
                                        – enter () time uses constant time O(1)
  • Similar behavior to both enter      algorithm to validate illegal entry
    and exit () time
                   Roundtrip Latency Analysis
Overview
• Influence of Scoped memory in the
 Roundtrip latency measures
Result Synopsis
• Average Measures:
  • For smaller clients, scoped
    memory incurs greater overhead
  • As requests increase, Scoped
    memory outperforms heap
• Dispersion Measures:
  • Considerable improvement in
    predictability
  • Dispersion improves as much as
    50%
• Worst-Case Measures:
  • Scoped memory bounds worst
    case                              – As number of requests increase, GC activity
                                        increases for Heap Memory.
  • Though mean values are greater
    99% and Worst case measures are   – Scope memory kicks in to reduce GC activity
    bounded                             thereby improving processing time
      Concluding Remarks & Future Work
Concluding Remarks
• We presented R&D efforts on integration of
  RTSJ and RT-CORBA
• Our efforts focus towards effective use of
  RTSJ and Real-time CORBA to improve
  QoS for Java based real-time systems




Future Real-Time CORBA Research
• Policies at the POA level for RTSJ aware users
• Use NHRT threads for request/response
  processing                                       Downloading ZEN
• Threading Models for RTSJ                        • www.zen.uci.edu
• Modeling RTSJ exceptions e.g.
 ScopedCycleException
• Complete implementation of Real-time CORBA
  specification
                         References
• ZEN open-source download & web page:
  • http://www.zen.uci.edu

• Real-time Java (JSR-1):
  • http://java.sun.com/aboutJava/communityprocess/jsr/
    jsr_001_real_time.html

• Dynamic scheduling RFP:
  • http://www.omg.org/techprocess/meetings/schedule/
    Dynamic_Scheduling_RFP.html

• Distributed Real-time Java (JSR-50):
  • http://java.sun.com/aboutJava/communityprocess/jsr/
    jsr_050_drt.html

• AspectJ web page:
  • http://www.aspectJ.org

• JRate
  • http://tao.doc.wustl.edu/~corsaro/jRate/

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:1/18/2012
language:
pages:25