#include <RT_ORB.h>
Inheritance diagram for TAO_RT_ORB:
Public Member Functions | |
TAO_RT_ORB (TAO_ORB_Core *orb_core, TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan lifespan, ACE_Time_Value const &dynamic_thread_time) | |
Constructor. | |
virtual RTCORBA::Mutex_ptr | create_mutex (void) |
virtual void | destroy_mutex (RTCORBA::Mutex_ptr the_mutex) |
virtual RTCORBA::Mutex_ptr | create_named_mutex (const char *name, CORBA::Boolean_out created_flag) |
virtual RTCORBA::Mutex_ptr | open_named_mutex (const char *name) |
Retrieve a previously created mutex. | |
RTCORBA::TCPProtocolProperties_ptr | create_tcp_protocol_properties (CORBA::Long send_buffer_size, CORBA::Long recv_buffer_size, CORBA::Boolean keep_alive, CORBA::Boolean dont_route, CORBA::Boolean no_delay, CORBA::Boolean enable_network_priority) |
RTCORBA::UnixDomainProtocolProperties_ptr | create_unix_domain_protocol_properties (CORBA::Long send_buffer_size, CORBA::Long recv_buffer_size) |
RTCORBA::SharedMemoryProtocolProperties_ptr | create_shared_memory_protocol_properties (CORBA::Long send_buffer_size, CORBA::Long recv_buffer_size, CORBA::Boolean keep_alive, CORBA::Boolean dont_route, CORBA::Boolean no_delay, CORBA::Long preallocate_buffer_size, const char *mmap_filename, const char *mmap_lockname) |
RTCORBA::UserDatagramProtocolProperties_ptr | create_user_datagram_protocol_properties (CORBA::Long send_buffer_size, CORBA::Long recv_buffer_size, CORBA::Boolean enable_network_priority) |
RTCORBA::StreamControlProtocolProperties_ptr | create_stream_control_protocol_properties (CORBA::Long send_buffer_size, CORBA::Long recv_buffer_size, CORBA::Boolean keep_alive, CORBA::Boolean dont_route, CORBA::Boolean no_delay, CORBA::Boolean enable_network_priority) |
virtual RTCORBA::ThreadpoolId | create_threadpool (CORBA::ULong stacksize, CORBA::ULong static_threads, CORBA::ULong dynamic_threads, RTCORBA::Priority default_priority, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size) |
Create a RTCORBA threadpool to manage a set of threads without lanes. | |
virtual RTCORBA::ThreadpoolId | create_threadpool_with_lanes (CORBA::ULong stacksize, const RTCORBA::ThreadpoolLanes &lanes, CORBA::Boolean allow_borrowing, CORBA::Boolean allow_request_buffering, CORBA::ULong max_buffered_requests, CORBA::ULong max_request_buffer_size) |
virtual void | destroy_threadpool (RTCORBA::ThreadpoolId threadpool) |
Free the resources associated with the specified threadpool. | |
virtual RTCORBA::PriorityModelPolicy_ptr | create_priority_model_policy (RTCORBA::PriorityModel priority_model, RTCORBA::Priority server_priority) |
Create a priority model policy for use when configuring a POA. | |
virtual RTCORBA::ThreadpoolPolicy_ptr | create_threadpool_policy (RTCORBA::ThreadpoolId threadpool) |
Create a ThreadpoolPolicy instance for POA creation. | |
virtual RTCORBA::PriorityBandedConnectionPolicy_ptr | create_priority_banded_connection_policy (const RTCORBA::PriorityBands &priority_bands) |
virtual RTCORBA::PrivateConnectionPolicy_ptr | create_private_connection_policy (void) |
virtual RTCORBA::ServerProtocolPolicy_ptr | create_server_protocol_policy (const RTCORBA::ProtocolList &protocols) |
virtual RTCORBA::ClientProtocolPolicy_ptr | create_client_protocol_policy (const RTCORBA::ProtocolList &protocols) |
TAO_ORB_Core * | orb_core (void) const |
Reference to our creating ORB Core. | |
TAO_Thread_Pool_Manager & | tp_manager (void) const |
Get the Thread Pool Manager. | |
Static Public Member Functions | |
static int | modify_thread_scheduling_policy (CORBA::ORB_ptr orb) |
Protected Member Functions | |
virtual | ~TAO_RT_ORB (void) |
Protected Attributes | |
TAO_ORB_Core *const | orb_core_ |
Reference to our creating ORB Core. | |
TAO_Named_RT_Mutex_Manager | mutex_mgr_ |
mutex_mgr_ manages the names associated with named mutexes. | |
TAO_Thread_Pool_Manager * | tp_manager_ |
Thread Pool Manager. | |
TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan | lifespan_ |
Dynamic thread lifespan policy. | |
ACE_Time_Value const | dynamic_thread_time_ |
Dynamic thread run time. |
Creates and destroys RT CORBA objects, i.e., policies, threadpools, mutexes.
Definition at line 93 of file RT_ORB.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_RT_ORB::TAO_RT_ORB | ( | TAO_ORB_Core * | orb_core, | |
TAO_RT_ORBInitializer::TAO_RTCORBA_DT_LifeSpan | lifespan, | |||
ACE_Time_Value const & | dynamic_thread_time | |||
) |
Constructor.
Definition at line 23 of file RT_ORB.cpp.
References TAO_RT_Thread_Lane_Resources_Manager::tp_manager().
00026 : orb_core_ (orb_core), 00027 mutex_mgr_ (), 00028 tp_manager_ (0), 00029 lifespan_ (lifespan), 00030 dynamic_thread_time_ (dynamic_thread_time) 00031 { 00032 TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager = 00033 &this->orb_core_->thread_lane_resources_manager (); 00034 00035 TAO_RT_Thread_Lane_Resources_Manager *rt_thread_lane_resources_manager = 00036 dynamic_cast <TAO_RT_Thread_Lane_Resources_Manager *> (thread_lane_resources_manager); 00037 00038 if (!rt_thread_lane_resources_manager) 00039 throw CORBA::INTERNAL (); 00040 00041 this->tp_manager_ = 00042 &rt_thread_lane_resources_manager->tp_manager (); 00043 }
TAO_RT_ORB::~TAO_RT_ORB | ( | void | ) | [protected, virtual] |
Protected destructor to enforce proper memory management of this reference counted object.
Definition at line 45 of file RT_ORB.cpp.
RTCORBA::ClientProtocolPolicy_ptr TAO_RT_ORB::create_client_protocol_policy | ( | const RTCORBA::ProtocolList & | protocols | ) | [virtual] |
Create a ClientProtocolPolicy instance to select and configure communication protocols on the client side.
Definition at line 426 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00427 { 00428 TAO_ClientProtocolPolicy *tmp = 0; 00429 ACE_NEW_THROW_EX (tmp, 00430 TAO_ClientProtocolPolicy (protocols), 00431 CORBA::NO_MEMORY (TAO::VMCID, 00432 CORBA::COMPLETED_NO)); 00433 00434 return tmp; 00435 }
RTCORBA::Mutex_ptr TAO_RT_ORB::create_mutex | ( | void | ) | [virtual] |
Create a new mutex. Mutexes returned by this method are the same as those used internally by the ORB, so that consistant priority inheritance/piority ceiling semantics can be guaranteed.
Definition at line 50 of file RT_ORB.cpp.
References TAO_Named_RT_Mutex_Manager::create_mutex(), and mutex_mgr_.
00051 { 00052 return this->mutex_mgr_.create_mutex (); 00053 }
RTCORBA::Mutex_ptr TAO_RT_ORB::create_named_mutex | ( | const char * | name, | |
CORBA::Boolean_out | created_flag | |||
) | [virtual] |
Create a mutex and assign a name to it. If the mutex already exists, it is returned and the created_flag is set to 0.
Definition at line 63 of file RT_ORB.cpp.
References TAO_Named_RT_Mutex_Manager::create_named_mutex(), and mutex_mgr_.
00065 { 00066 return this->mutex_mgr_.create_named_mutex (name, created_flag); 00067 }
RTCORBA::PriorityBandedConnectionPolicy_ptr TAO_RT_ORB::create_priority_banded_connection_policy | ( | const RTCORBA::PriorityBands & | priority_bands | ) | [virtual] |
Create a PriorityBandedConnectionPolicy instance for use on either the client or server side
Definition at line 389 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00391 { 00392 TAO_PriorityBandedConnectionPolicy *tmp = 0; 00393 ACE_NEW_THROW_EX (tmp, 00394 TAO_PriorityBandedConnectionPolicy (priority_bands), 00395 CORBA::NO_MEMORY (TAO::VMCID, 00396 CORBA::COMPLETED_NO)); 00397 00398 return tmp; 00399 }
RTCORBA::PriorityModelPolicy_ptr TAO_RT_ORB::create_priority_model_policy | ( | RTCORBA::PriorityModel | priority_model, | |
RTCORBA::Priority | server_priority | |||
) | [virtual] |
Create a priority model policy for use when configuring a POA.
Definition at line 364 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00366 { 00367 TAO_PriorityModelPolicy *tmp = 0; 00368 ACE_NEW_THROW_EX (tmp, 00369 TAO_PriorityModelPolicy (priority_model, server_priority), 00370 CORBA::NO_MEMORY (TAO::VMCID, 00371 CORBA::COMPLETED_NO)); 00372 00373 return tmp; 00374 }
RTCORBA::PrivateConnectionPolicy_ptr TAO_RT_ORB::create_private_connection_policy | ( | void | ) | [virtual] |
Create a PrivateConnectionPolicy instance to use on client to request a private (non-multiplexed) transport connection to the server.
Definition at line 402 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00403 { 00404 TAO_PrivateConnectionPolicy *tmp = 0; 00405 ACE_NEW_THROW_EX (tmp, 00406 TAO_PrivateConnectionPolicy (), 00407 CORBA::NO_MEMORY (TAO::VMCID, 00408 CORBA::COMPLETED_NO)); 00409 00410 return tmp; 00411 }
RTCORBA::ServerProtocolPolicy_ptr TAO_RT_ORB::create_server_protocol_policy | ( | const RTCORBA::ProtocolList & | protocols | ) | [virtual] |
Create a ServerProtocolPolicy instance to select and configure communication protocols on the server side.
Definition at line 414 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00415 { 00416 TAO_ServerProtocolPolicy *tmp = 0; 00417 ACE_NEW_THROW_EX (tmp, 00418 TAO_ServerProtocolPolicy (protocols), 00419 CORBA::NO_MEMORY (TAO::VMCID, 00420 CORBA::COMPLETED_NO)); 00421 00422 return tmp; 00423 }
RTCORBA::SharedMemoryProtocolProperties_ptr TAO_RT_ORB::create_shared_memory_protocol_properties | ( | CORBA::Long | send_buffer_size, | |
CORBA::Long | recv_buffer_size, | |||
CORBA::Boolean | keep_alive, | |||
CORBA::Boolean | dont_route, | |||
CORBA::Boolean | no_delay, | |||
CORBA::Long | preallocate_buffer_size, | |||
const char * | mmap_filename, | |||
const char * | mmap_lockname | |||
) |
Definition at line 249 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00258 { 00259 TAO_SharedMemory_Protocol_Properties *tmp = 0; 00260 ACE_NEW_THROW_EX (tmp, 00261 TAO_SharedMemory_Protocol_Properties (send_buffer_size, 00262 recv_buffer_size, 00263 keep_alive, 00264 dont_route, 00265 no_delay, 00266 preallocate_buffer_size, 00267 mmap_filename, 00268 mmap_lockname), 00269 CORBA::NO_MEMORY (TAO::VMCID, 00270 CORBA::COMPLETED_NO)); 00271 00272 return tmp; 00273 }
RTCORBA::StreamControlProtocolProperties_ptr TAO_RT_ORB::create_stream_control_protocol_properties | ( | CORBA::Long | send_buffer_size, | |
CORBA::Long | recv_buffer_size, | |||
CORBA::Boolean | keep_alive, | |||
CORBA::Boolean | dont_route, | |||
CORBA::Boolean | no_delay, | |||
CORBA::Boolean | enable_network_priority | |||
) |
Definition at line 294 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00302 { 00303 TAO_StreamControl_Protocol_Properties *tmp = 0; 00304 ACE_NEW_THROW_EX (tmp, 00305 TAO_StreamControl_Protocol_Properties ( 00306 send_buffer_size, 00307 recv_buffer_size, 00308 keep_alive, 00309 dont_route, 00310 no_delay, 00311 enable_network_priority), 00312 CORBA::NO_MEMORY (TAO::VMCID, 00313 CORBA::COMPLETED_NO)); 00314 00315 return tmp; 00316 }
RTCORBA::TCPProtocolProperties_ptr TAO_RT_ORB::create_tcp_protocol_properties | ( | CORBA::Long | send_buffer_size, | |
CORBA::Long | recv_buffer_size, | |||
CORBA::Boolean | keep_alive, | |||
CORBA::Boolean | dont_route, | |||
CORBA::Boolean | no_delay, | |||
CORBA::Boolean | enable_network_priority | |||
) |
Create and return a TCPProtocolProperties instance with the specified parameters.
Definition at line 210 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00217 { 00218 TAO_TCP_Protocol_Properties *tmp = 0; 00219 ACE_NEW_THROW_EX (tmp, 00220 TAO_TCP_Protocol_Properties (send_buffer_size, 00221 recv_buffer_size, 00222 keep_alive, 00223 dont_route, 00224 no_delay, 00225 enable_network_priority), 00226 CORBA::NO_MEMORY (TAO::VMCID, 00227 CORBA::COMPLETED_NO)); 00228 00229 return tmp; 00230 }
RTCORBA::ThreadpoolId TAO_RT_ORB::create_threadpool | ( | CORBA::ULong | stacksize, | |
CORBA::ULong | static_threads, | |||
CORBA::ULong | dynamic_threads, | |||
RTCORBA::Priority | default_priority, | |||
CORBA::Boolean | allow_request_buffering, | |||
CORBA::ULong | max_buffered_requests, | |||
CORBA::ULong | max_request_buffer_size | |||
) | [virtual] |
Create a RTCORBA threadpool to manage a set of threads without lanes.
Definition at line 319 of file RT_ORB.cpp.
References TAO_Thread_Pool_Manager::create_threadpool(), and tp_manager_.
00327 { 00328 return this->tp_manager_->create_threadpool (stacksize, 00329 static_threads, 00330 dynamic_threads, 00331 default_priority, 00332 allow_request_buffering, 00333 max_buffered_requests, 00334 max_request_buffer_size, 00335 this->lifespan_, 00336 this->dynamic_thread_time_); 00337 }
RTCORBA::ThreadpoolPolicy_ptr TAO_RT_ORB::create_threadpool_policy | ( | RTCORBA::ThreadpoolId | threadpool | ) | [virtual] |
Create a ThreadpoolPolicy instance for POA creation.
Definition at line 377 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00378 { 00379 TAO_ThreadpoolPolicy *tmp = 0; 00380 ACE_NEW_THROW_EX (tmp, 00381 TAO_ThreadpoolPolicy (threadpool), 00382 CORBA::NO_MEMORY (TAO::VMCID, 00383 CORBA::COMPLETED_NO)); 00384 00385 return tmp; 00386 }
RTCORBA::ThreadpoolId TAO_RT_ORB::create_threadpool_with_lanes | ( | CORBA::ULong | stacksize, | |
const RTCORBA::ThreadpoolLanes & | lanes, | |||
CORBA::Boolean | allow_borrowing, | |||
CORBA::Boolean | allow_request_buffering, | |||
CORBA::ULong | max_buffered_requests, | |||
CORBA::ULong | max_request_buffer_size | |||
) | [virtual] |
Create a threadpool and separate it into subsets based on priorities.
Definition at line 340 of file RT_ORB.cpp.
References TAO_Thread_Pool_Manager::create_threadpool_with_lanes(), and tp_manager_.
00346 { 00347 return this->tp_manager_->create_threadpool_with_lanes (stacksize, 00348 lanes, 00349 allow_borrowing, 00350 allow_request_buffering, 00351 max_buffered_requests, 00352 max_request_buffer_size, 00353 this->lifespan_, 00354 this->dynamic_thread_time_); 00355 }
RTCORBA::UnixDomainProtocolProperties_ptr TAO_RT_ORB::create_unix_domain_protocol_properties | ( | CORBA::Long | send_buffer_size, | |
CORBA::Long | recv_buffer_size | |||
) |
Definition at line 233 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00236 { 00237 TAO_UnixDomain_Protocol_Properties *tmp = 0; 00238 ACE_NEW_THROW_EX (tmp, 00239 TAO_UnixDomain_Protocol_Properties ( 00240 send_buffer_size, 00241 recv_buffer_size), 00242 CORBA::NO_MEMORY (TAO::VMCID, 00243 CORBA::COMPLETED_NO)); 00244 00245 return tmp; 00246 }
RTCORBA::UserDatagramProtocolProperties_ptr TAO_RT_ORB::create_user_datagram_protocol_properties | ( | CORBA::Long | send_buffer_size, | |
CORBA::Long | recv_buffer_size, | |||
CORBA::Boolean | enable_network_priority | |||
) |
Definition at line 276 of file RT_ORB.cpp.
References ACE_NEW_THROW_EX, CORBA::COMPLETED_NO, and TAO::VMCID.
00280 { 00281 TAO_UserDatagram_Protocol_Properties *tmp = 0; 00282 ACE_NEW_THROW_EX (tmp, 00283 TAO_UserDatagram_Protocol_Properties ( 00284 send_buffer_size, 00285 recv_buffer_size, 00286 enable_network_priority), 00287 CORBA::NO_MEMORY (TAO::VMCID, 00288 CORBA::COMPLETED_NO)); 00289 00290 return tmp; 00291 }
void TAO_RT_ORB::destroy_mutex | ( | RTCORBA::Mutex_ptr | the_mutex | ) | [virtual] |
Destroy a mutex. Currently this is a no-op since RTCORBA::Mutex instances are destroyed as soon as their reference counts go to 0.
Definition at line 56 of file RT_ORB.cpp.
References TAO_Named_RT_Mutex_Manager::destroy_mutex(), and mutex_mgr_.
00057 { 00058 this->mutex_mgr_.destroy_mutex (mutex); 00059 }
void TAO_RT_ORB::destroy_threadpool | ( | RTCORBA::ThreadpoolId | threadpool | ) | [virtual] |
Free the resources associated with the specified threadpool.
Definition at line 358 of file RT_ORB.cpp.
References TAO_Thread_Pool_Manager::destroy_threadpool(), and tp_manager_.
00359 { 00360 this->tp_manager_->destroy_threadpool (threadpool); 00361 }
int TAO_RT_ORB::modify_thread_scheduling_policy | ( | CORBA::ORB_ptr | orb | ) | [static] |
This method changes the scheduling policy of the calling thread to match the scheduling policy specified in the svc.conf file. The priority of the calling thread will be set to the minimum priority supported by that scheduling policy.
This method make sense on those platform (e.g., Linux) where PTHREAD_SCOPE_SYSTEM is the only scheduling scope supported. On other platforms, this method is a no-op since the only way to get the real-time threading behavior is to setup the PTHREAD_SCOPE_SYSTEM scheduling scope when a thread is being created. On such platforms, one can set the correct scheduling scope and policy when creating the thread, thus not needing to use this method.
Definition at line 451 of file RT_ORB.cpp.
References ACE_NOTSUP_RETURN, TAO_ORB_Parameters::ace_sched_policy(), CORBA::ORB::orb_core(), TAO_ORB_Core::orb_params(), ACE_Sched_Params::priority_min(), ACE_Thread::self(), and ACE_Thread::setprio().
00452 { 00453 // 00454 // This method changes the scheduling policy of the calling thread 00455 // to match the scheduling policy specified in the svc.conf file. 00456 // The priority of the calling thread will be set to the minimum 00457 // priority supported by that scheduling policy. 00458 // 00459 // This method make sense on those platform (e.g., Linux) where 00460 // PTHREAD_SCOPE_SYSTEM is the only scheduling scope supported. On 00461 // other platforms, this method is a no-op since the only way to get 00462 // the real-time threading behavior is to setup the 00463 // PTHREAD_SCOPE_SYSTEM scheduling scope when a thread is being 00464 // created. On such platforms, one can set the correct scheduling 00465 // scope and policy when creating the thread, thus not needing to 00466 // use this method. 00467 // 00468 00469 #if defined (linux) 00470 00471 int const sched_policy = orb->orb_core ()->orb_params ()->ace_sched_policy (); 00472 00473 int const minimum_priority = ACE_Sched_Params::priority_min (sched_policy); 00474 00475 ACE_hthread_t thread_id; 00476 ACE_Thread::self (thread_id); 00477 00478 return ACE_Thread::setprio (thread_id, minimum_priority, sched_policy); 00479 00480 #else /* linux */ 00481 00482 ACE_UNUSED_ARG (orb); 00483 ACE_NOTSUP_RETURN (-1); 00484 00485 #endif /* linux */ 00486 00487 }
RTCORBA::Mutex_ptr TAO_RT_ORB::open_named_mutex | ( | const char * | name | ) | [virtual] |
Retrieve a previously created mutex.
Definition at line 70 of file RT_ORB.cpp.
References mutex_mgr_, and TAO_Named_RT_Mutex_Manager::open_named_mutex().
00071 { 00072 return this->mutex_mgr_.open_named_mutex (name); 00073 }
TAO_ORB_Core * TAO_RT_ORB::orb_core | ( | void | ) | const |
Reference to our creating ORB Core.
Reimplemented from CORBA::Object.
Definition at line 444 of file RT_ORB.cpp.
References orb_core_.
00445 { 00446 return this->orb_core_; 00447 }
TAO_Thread_Pool_Manager & TAO_RT_ORB::tp_manager | ( | void | ) | const |
Get the Thread Pool Manager.
Definition at line 438 of file RT_ORB.cpp.
References tp_manager_.
00439 { 00440 return *this->tp_manager_; 00441 }
ACE_Time_Value const TAO_RT_ORB::dynamic_thread_time_ [protected] |
TAO_Named_RT_Mutex_Manager TAO_RT_ORB::mutex_mgr_ [protected] |
mutex_mgr_ manages the names associated with named mutexes.
Definition at line 268 of file RT_ORB.h.
Referenced by create_mutex(), create_named_mutex(), destroy_mutex(), and open_named_mutex().
TAO_ORB_Core* const TAO_RT_ORB::orb_core_ [protected] |
Reference to our creating ORB Core.
Reimplemented from CORBA::Object.
Definition at line 265 of file RT_ORB.h.
Referenced by orb_core().
TAO_Thread_Pool_Manager* TAO_RT_ORB::tp_manager_ [protected] |
Thread Pool Manager.
Definition at line 271 of file RT_ORB.h.
Referenced by create_threadpool(), create_threadpool_with_lanes(), destroy_threadpool(), and tp_manager().