Implementing RT-CORBA Spec in TAO Jan.9,2002 Do-Hoon, Kim
Contents Overview of ACE RT-CORBA extention -PriorityModelPolicy(example) -Threadpools -explicit binding Concluding Remarks
Overview of ACE ACE(Adaptive Communication Environment) -open source object-oriented(OO) frameworks that implements many core patterns for concurrent communication software. The structure and functionality of ACE.. -ACE OS Adapter Layer -C++ Wrapper Facades for OS Interfaces -Frameworks -Distributed Services and Components
The Structure and Functionality of ACE
TAO The ACE ORB(TAO) - TAO is a real-time implementation of CORBA built using the framework components and patterns provided by ACE
ORB Endsystem Features for Real-Time CORBA
RT-CORBA Managing Processor Resources Real time application : strict control over the scheduling and execution of processor resources RT-CORBA spec….. - determine the priority at which CORBA invocations will be processed - allow servers to pre-define pools of threads
Priority Mechanisms Priority models : Server declared priorities : allow a server to dictate the priority at which an invocation made on a particular object will execute Client propagated priorities : -- allows client to declare invocation priority -- each invocation carries the CORBA priority
PriorityModelPolicy //IDL Module RTCORBA{ //Priority Model Policy const CORBA::PolicyType PRIORITY_MODEL_POLICY_TYPE=40; enum PriorityModel{ CLIENT_PROPAGATED, SERVER_DECLARED }; interface PriorityModelPolicy : CORBA :: Policy{ readonly attribute PriorityModel priority_model; readonly attribute Priority server_priority; }; };
Priority model
Server_Declared example //client Check_policy() { Get_policy() … Return s1_priority; } Main() { //object reference obtain Object=String_to_object(ior); Check_policy(); //Testing invocation test_method(s1_priority); //Shut down Server ORB //server test_method(s1_priority,..) { s2_priority=current_priority if(s2_priority==s1_priority) { //your coding… }} Create_object(…) { id=activate_object_with_priority(servant, s1_priority) //id_to_referencefile } Main() { … //Create child POA with SERVER_DECLARED PriorityModelPolicy Create_priority_model_policy(…) create_object(…) //orb start
Threadpools Allow server developers to preallocate pools of threads and to set certain thread attributes Is created with a fixed number of statically allocated threads that an ORB uses to process client messages. thread pool styles – with and without lanes
Thread pool without lanes Following parameters must be configured -- static_threads : the number of threads that will be pre-created -- dynamic_threads : the number of additional threads -- default_priority : CORBA priority that the static threads will be created with.
Thread pool with lanes Following parameters specified --lane_priority : CORBA priority that all threads in this lane will run at --static_threads , dynamic_threads Thread_borrowing permitted : it may “borrow” a thread from a lane with a lower priority The borrowed thread has its CORBA Priority raised to that of the lane that requires it.
Threadpool //IDL module RTCORBA { typedef unsigned long ThreadpoolId; struct ThreadpoolLane{ Priority lane_priority; unsigned long static_threads; unsigned long dynamic_threads; }; ….. Interface RTORB { ThreadpoolPolicy create_threadpool_policy{ in ThreadpoolId threadpool); ThreadpoolId create_threadpool( in unsigned long stacksize, in unsigned long static_threads, in Priority dynamic_priority, in boolean allow_request_buffering, in unsigned long max_buffered_requests, in unsigned long max_request_buffer_size); ThreadpoolId create_threadpool_with lanes ( … in ThreadpoolLanes lanes, ); };
POA Thread Pools in Real-time CORBA
Request Buffering A pool can be optionally pre-configured for a maximum buffer size or number of requests That is when all of the available thread concurrency is in use and when any capability to borrow threads has been exhausted then additional requests received are buffered
Request Buffering
Expliciting binding Use the validate_connection operation defined on the CORBA::Object interface in the CORBA Messaging spec Priority-banded connections Private connections
Priority-banded connections allow clients to specify explicit priorities for each network connection Client are responsible for specifying policies that define one or more priority-bands when they establish connections explicitly Server received _bind_priority_band request (service context of the first invocation)allocate resources to the connectionsubsequent request on this connection are then processed at the requested priority
Private connections A connection cannot be reused for another two-way request until the reply for the previous request is received allows clients to select private connections that minimize the duration of any end-to-end priority inversions
Expliciting binding
Use Case:Avionics Mission Computing Mission Computing System -Display updates : low priority -Control events(actuator) : high priority End-to-end priority preservation required -Thredpools with lanes -CLIENT_PRORAGATED priority model -Explicit binding
Concluding Remarks RT-CORBA in TAO introduces important facilities for applications with QoS requirements Contributes to advancing the use of middleware in real-time distributed systems. Future work : analysis of TAO implementation parts , Performance Tests..