summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-27 09:28:40 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-07-27 09:28:40 +0000
commit230d2cfd0d008aa56ce073186081a167c0b91e7e (patch)
treee9ebff0c7a537865a44659837e75c9e184ac42df
parent8c2634bd037d691ecf943668d18b696dd4e356d7 (diff)
downloadATCD-230d2cfd0d008aa56ce073186081a167c0b91e7e.tar.gz
Thread Pool changes....
-rw-r--r--TAO/tao/Default_Thread_Lane_Resources_Manager.cpp47
-rw-r--r--TAO/tao/Default_Thread_Lane_Resources_Manager.h7
-rw-r--r--TAO/tao/ORB_Core.cpp61
-rw-r--r--TAO/tao/ORB_Core.h16
-rw-r--r--TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp106
-rw-r--r--TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.h9
-rw-r--r--TAO/tao/Reactor_Registry.cpp37
-rw-r--r--TAO/tao/Reactor_Registry.h92
-rw-r--r--TAO/tao/Reactor_Registry.i8
-rw-r--r--TAO/tao/Resource_Factory.cpp6
-rw-r--r--TAO/tao/Resource_Factory.h5
-rw-r--r--TAO/tao/Single_Reactor.cpp90
-rw-r--r--TAO/tao/Single_Reactor.h63
-rw-r--r--TAO/tao/Single_Reactor.i1
-rw-r--r--TAO/tao/Strategies/Reactor_Per_Priority.cpp218
-rw-r--r--TAO/tao/Strategies/Reactor_Per_Priority.h78
-rw-r--r--TAO/tao/Strategies/Reactor_Per_Priority.i6
-rw-r--r--TAO/tao/Strategies/TAO_Strategies.dsp20
-rw-r--r--TAO/tao/Strategies/advanced_resource.cpp57
-rw-r--r--TAO/tao/Strategies/advanced_resource.h8
-rw-r--r--TAO/tao/TAO.dsp24
-rw-r--r--TAO/tao/Thread_Lane_Resources.cpp5
-rw-r--r--TAO/tao/Thread_Lane_Resources_Manager.cpp26
-rw-r--r--TAO/tao/Thread_Lane_Resources_Manager.h16
-rw-r--r--TAO/tao/default_resource.cpp16
-rw-r--r--TAO/tao/default_resource.h8
26 files changed, 210 insertions, 820 deletions
diff --git a/TAO/tao/Default_Thread_Lane_Resources_Manager.cpp b/TAO/tao/Default_Thread_Lane_Resources_Manager.cpp
index e3ca26c983c..9a77c6c3edf 100644
--- a/TAO/tao/Default_Thread_Lane_Resources_Manager.cpp
+++ b/TAO/tao/Default_Thread_Lane_Resources_Manager.cpp
@@ -15,20 +15,23 @@ ACE_RCSID(tao, Default_Thread_Lane_Resources_Manager, "$Id$")
TAO_Default_Thread_Lane_Resources_Manager::TAO_Default_Thread_Lane_Resources_Manager (void)
: open_called_ (0),
- lane_resources_ (0),
- orb_core_ (0)
+ lane_resources_ (0)
{
}
TAO_Default_Thread_Lane_Resources_Manager::~TAO_Default_Thread_Lane_Resources_Manager (void)
{
+ delete this->lane_resources_;
}
int
TAO_Default_Thread_Lane_Resources_Manager::initialize (TAO_ORB_Core &orb_core)
{
- this->orb_core_ =
- &orb_core;
+ int result =
+ this->TAO_Thread_Lane_Resources_Manager::initialize (orb_core);
+
+ if (result != 0)
+ return result;
ACE_NEW_RETURN (this->lane_resources_,
TAO_Thread_Lane_Resources (orb_core),
@@ -71,8 +74,6 @@ void
TAO_Default_Thread_Lane_Resources_Manager::finalize (void)
{
this->lane_resources_->finalize ();
- delete this->lane_resources_;
- this->lane_resources_ = 0;
}
TAO_Thread_Lane_Resources &
@@ -84,7 +85,39 @@ TAO_Default_Thread_Lane_Resources_Manager::lane_resources (void)
TAO_Thread_Lane_Resources &
TAO_Default_Thread_Lane_Resources_Manager::default_lane_resources (void)
{
- return *this->lane_resources_;
+ return this->lane_resources ();
+}
+
+int
+TAO_Default_Thread_Lane_Resources_Manager::shutdown_all_reactors (CORBA_Environment &)
+{
+ TAO_Leader_Follower &leader_follower =
+ this->lane_resources_->leader_follower ();
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ ace_mon,
+ leader_follower.lock (),
+ -1);
+
+ // Wakeup all the threads waiting blocked in the event loop, this
+ // does not guarantee that they will all go away, but reduces the
+ // load on the POA....
+ ACE_Reactor *reactor =
+ leader_follower.reactor ();
+
+ reactor->wakeup_all_threads ();
+
+ // If there are some client threads running we have to wait until
+ // they finish, when the last one does it will shutdown the reactor
+ // for us. Meanwhile no new requests will be accepted because the
+ // POA will not process them.
+ if (!leader_follower.has_clients ())
+ {
+ // Wake up all waiting threads in the reactor.
+ reactor->end_reactor_event_loop ();
+ }
+
+ return 0;
}
ACE_STATIC_SVC_DEFINE (TAO_Default_Thread_Lane_Resources_Manager,
diff --git a/TAO/tao/Default_Thread_Lane_Resources_Manager.h b/TAO/tao/Default_Thread_Lane_Resources_Manager.h
index ffbea852256..1c0d82bf43c 100644
--- a/TAO/tao/Default_Thread_Lane_Resources_Manager.h
+++ b/TAO/tao/Default_Thread_Lane_Resources_Manager.h
@@ -42,8 +42,10 @@ public:
int open_default_resources (CORBA_Environment &ACE_TRY_ENV);
TAO_Thread_Lane_Resources &lane_resources (void);
-
TAO_Thread_Lane_Resources &default_lane_resources (void);
+ int shutdown_all_reactors (CORBA_Environment &ACE_TRY_ENV);
+
+protected:
/// Mutual exclusion for calling open.
TAO_SYNCH_MUTEX open_lock_;
@@ -52,9 +54,6 @@ public:
int open_called_;
TAO_Thread_Lane_Resources *lane_resources_;
-
- /// ORB_Core related to this thread lane.
- TAO_ORB_Core *orb_core_;
};
ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_Default_Thread_Lane_Resources_Manager)
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 54240e83e37..c7b659f595a 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -11,7 +11,6 @@
#include "debug.h"
#include "MProfile.h"
#include "Stub.h"
-#include "Reactor_Registry.h"
#include "Leader_Follower.h"
#include "Connector_Registry.h"
#include "Acceptor_Registry.h"
@@ -151,8 +150,6 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
use_tss_resources_ (0),
tss_resources_ (),
orb_resources_ (),
- reactor_registry_ (0),
- reactor_ (0),
has_shutdown_ (1),
thread_per_connection_use_timeout_ (1),
endpoint_selector_factory_ (0),
@@ -907,10 +904,6 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
else
this->use_tss_resources_ = use_tss_resources;
- this->reactor_registry_ =
- trf->get_reactor_registry ();
- this->reactor_registry_->open (this);
-
// @@ ????
// Make sure the reactor is initialized...
ACE_Reactor *reactor = this->reactor ();
@@ -1144,18 +1137,12 @@ TAO_ORB_Core::fini (void)
// Finalize lane resources.
this->thread_lane_resources_manager ().finalize ();
- // Pass reactor back to the resource factory.
- if (this->resource_factory_ != 0)
- this->resource_factory_->reclaim_reactor (this->reactor_);
-
// Release the priority mapping manager here since it can be used when
// shutting down the reactor above.
CORBA::release (this->rt_priority_mapping_manager_);
(void) TAO_Internal::close_services ();
- delete this->reactor_registry_;
-
if (this->message_block_dblock_allocator_)
this->message_block_dblock_allocator_->remove ();
delete this->message_block_dblock_allocator_;
@@ -1685,30 +1672,6 @@ TAO_ORB_Core::inherit_from_parent_thread (
if (tss_resources == 0)
return -1;
-#if 0
- if (tss_resources->reactor_ != 0)
- {
- // We'll use the spawning thread's reactor.
- TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources ();
- if (tss->reactor_ != 0 && TAO_debug_level > 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- "TAO (%P|%t) non nil reactor on thread startup!\n"));
-
- if (tss == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) %p\n",
- "TAO_ORB_Core::inherit_from_parent_thread"
- " (); no more TSS keys"),
- -1);
-
- if (/* tss->owns_resources_ != 0 && */ !tss->inherited_reactor_)
- delete tss->reactor_;
- }
- tss->reactor_ = tss_resources->reactor_;
- tss->inherited_reactor_ = 1;
- }
-#endif /* 0 */
return 0;
}
@@ -1995,13 +1958,13 @@ TAO_ORB_Core::is_collocated (const TAO_MProfile& mprofile)
TAO_Leader_Follower &
TAO_ORB_Core::leader_follower (void)
{
- return this->reactor_registry_->leader_follower ();
+ return this->lane_resources ().leader_follower ();
}
TAO_LF_Strategy &
TAO_ORB_Core::lf_strategy (void)
{
- return this->reactor_registry_->lf_strategy ();
+ return this->thread_lane_resources_manager ().lf_strategy ();
}
int
@@ -2109,14 +2072,18 @@ TAO_ORB_Core::shutdown (CORBA::Boolean wait_for_completion,
{
this->adapter_registry_.check_close (wait_for_completion,
ACE_TRY_ENV);
+ ACE_CHECK;
+
this->adapter_registry_.close (wait_for_completion,
ACE_TRY_ENV);
+ ACE_CHECK;
// Set the shutdown flag
this->has_shutdown_ = 1;
// Shutdown all the reactors....
- this->reactor_registry_->shutdown_all ();
+ this->thread_lane_resources_manager ().shutdown_all_reactors (ACE_TRY_ENV);
+ ACE_CHECK;
// Grab the thread manager
ACE_Thread_Manager *tm = this->thr_mgr ();
@@ -2842,13 +2809,7 @@ TAO_ORB_Core::create_data_block_i (size_t size,
ACE_Reactor *
TAO_ORB_Core::reactor (void)
{
- return this->reactor_registry_->reactor ();
-}
-
-ACE_Reactor *
-TAO_ORB_Core::reactor (TAO_Acceptor *acceptor)
-{
- return this->reactor_registry_->reactor (acceptor);
+ return this->leader_follower ().reactor ();
}
CORBA::Object_ptr
@@ -3055,8 +3016,6 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void)
client_leader_thread_ (0),
leader_follower_condition_variable_ (0),
lane_ (0),
- reactor_registry_ (0),
- reactor_registry_cookie_ (0),
ts_objects_ (),
orb_core_ (0)
{
@@ -3087,10 +3046,6 @@ TAO_ORB_Core_TSS_Resources::~TAO_ORB_Core_TSS_Resources (void)
delete this->leader_follower_condition_variable_;
this->leader_follower_condition_variable_ = 0;
- if (this->reactor_registry_ != 0)
- this->reactor_registry_->destroy_tss_cookie (
- this->reactor_registry_cookie_);
-
//@@ This is broken on platforms that use TSS emulation since this
// destructor is invoked after the ORB. Since we're under
// pressure to release a beta, we'll have to leak the TSS objects
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 0a0f4737973..6e0a93c44d9 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -56,7 +56,6 @@ class TAO_Server_Strategy_Factory;
class TAO_Transport_Cache_Manager;
class TAO_TSS_Resources;
-class TAO_Reactor_Registry;
class TAO_Leader_Follower;
class TAO_LF_Strategy;
class TAO_RT_ORB;
@@ -155,13 +154,6 @@ public:
/// Lane for this thread.
void *lane_;
- /// The Reactor Holder that we should callback when destroying the
- /// cookie.
- TAO_Reactor_Registry *reactor_registry_;
-
- /// A TSS magic cookie used by the Reactor_Registry
- void *reactor_registry_cookie_;
-
/// Generic container for thread-specific objects.
ACE_Array_Base<void *> ts_objects_;
@@ -259,7 +251,6 @@ public:
/// Wrappers that forward the request to the concurrency strategy.
ACE_Reactor *reactor (void);
- ACE_Reactor *reactor (TAO_Acceptor *acceptor);
/// Get the ACE_Thread_Manager
ACE_Thread_Manager *thr_mgr (void);
@@ -1212,13 +1203,6 @@ protected:
/// then they are stored here...
TAO_ORB_Core_TSS_Resources orb_resources_;
- /// The server concurrency strategy.
- TAO_Reactor_Registry *reactor_registry_;
-
- /// The reactor used for pure-clients, otherwise it comes from the
- /// reactor_registry.
- ACE_Reactor *reactor_;
-
/// Flag which denotes that the ORB has been shutdown.
int has_shutdown_;
diff --git a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp
index b65ab51514d..b1d09e544a7 100644
--- a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp
+++ b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp
@@ -8,6 +8,7 @@ ACE_RCSID(RTCORBA, RT_Thread_Lane_Resources_Manager, "$Id$")
#include "tao/Acceptor_Registry.h"
#include "tao/Thread_Lane_Resources.h"
#include "tao/RTCORBA/Thread_Pool.h"
+#include "tao/RTCORBA/RT_ORB.h"
#include "tao/Leader_Follower.h"
#if !defined (__ACE_INLINE__)
@@ -17,7 +18,7 @@ ACE_RCSID(RTCORBA, RT_Thread_Lane_Resources_Manager, "$Id$")
TAO_RT_Thread_Lane_Resources_Manager::TAO_RT_Thread_Lane_Resources_Manager (void)
: open_called_ (0),
default_lane_resources_ (0),
- orb_core_ (0)
+ tp_manager_ (0)
{
}
@@ -29,8 +30,11 @@ TAO_RT_Thread_Lane_Resources_Manager::~TAO_RT_Thread_Lane_Resources_Manager (voi
int
TAO_RT_Thread_Lane_Resources_Manager::initialize (TAO_ORB_Core &orb_core)
{
- this->orb_core_ =
- &orb_core;
+ int result =
+ this->TAO_Thread_Lane_Resources_Manager::initialize (orb_core);
+
+ if (result != 0)
+ return result;
ACE_NEW_RETURN (this->default_lane_resources_,
TAO_Thread_Lane_Resources (orb_core),
@@ -74,6 +78,30 @@ void
TAO_RT_Thread_Lane_Resources_Manager::finalize (void)
{
this->default_lane_resources_->finalize ();
+
+ TAO_Thread_Pool_Manager::THREAD_POOLS &thread_pools =
+ this->tp_manager_->thread_pools ();
+
+ for (TAO_Thread_Pool_Manager::THREAD_POOLS::iterator pool_iterator =
+ thread_pools.begin ();
+ pool_iterator != thread_pools.end ();
+ ++pool_iterator)
+ {
+ TAO_Thread_Lane **lanes =
+ (*pool_iterator).int_id_->lanes ();
+ CORBA::ULong number_of_lanes =
+ (*pool_iterator).int_id_->number_of_lanes ();
+
+ for (CORBA::ULong lane = 0;
+ lane != number_of_lanes;
+ ++lane)
+ {
+ TAO_Thread_Lane_Resources &lane_resources =
+ lanes[lane]->resources ();
+
+ lane_resources.finalize ();
+ }
+ }
}
TAO_Thread_Lane_Resources &
@@ -99,6 +127,78 @@ TAO_RT_Thread_Lane_Resources_Manager::default_lane_resources (void)
return *this->default_lane_resources_;
}
+int
+TAO_RT_Thread_Lane_Resources_Manager::shutdown_all_reactors (CORBA_Environment &ACE_TRY_ENV)
+{
+ // Get the RTORB.
+ CORBA::Object_var object =
+ this->orb_core_->resolve_rt_orb (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (-1);
+
+ RTCORBA::RTORB_var rt_orb =
+ RTCORBA::RTORB::_narrow (object,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (-1);
+
+ TAO_RT_ORB *tao_rt_orb =
+ ACE_dynamic_cast (TAO_RT_ORB *,
+ rt_orb.in ());
+
+ this->tp_manager_ =
+ &tao_rt_orb->tp_manager ();
+
+ TAO_Thread_Pool_Manager::THREAD_POOLS &thread_pools =
+ this->tp_manager_->thread_pools ();
+
+ for (TAO_Thread_Pool_Manager::THREAD_POOLS::iterator pool_iterator =
+ thread_pools.begin ();
+ pool_iterator != thread_pools.end ();
+ ++pool_iterator)
+ {
+ TAO_Thread_Lane **lanes =
+ (*pool_iterator).int_id_->lanes ();
+ CORBA::ULong number_of_lanes =
+ (*pool_iterator).int_id_->number_of_lanes ();
+
+ for (CORBA::ULong lane = 0;
+ lane != number_of_lanes;
+ ++lane)
+ {
+ TAO_Thread_Lane_Resources &lane_resources =
+ lanes[lane]->resources ();
+
+ TAO_Leader_Follower &leader_follower =
+ lane_resources.leader_follower ();
+
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
+ ace_mon,
+ leader_follower.lock (),
+ -1);
+
+ // Wakeup all the threads waiting blocked in the event loop,
+ // this does not guarantee that they will all go away, but
+ // reduces the load on the POA....
+ ACE_Reactor *reactor =
+ leader_follower.reactor ();
+
+ reactor->wakeup_all_threads ();
+
+ // If there are some client threads running we have to wait
+ // until they finish, when the last one does it will
+ // shutdown the reactor for us. Meanwhile no new requests
+ // will be accepted because the POA will not process them.
+
+ if (!leader_follower.has_clients ())
+ {
+ // Wake up all waiting threads in the reactor.
+ reactor->end_reactor_event_loop ();
+ }
+ }
+ }
+
+ return 0;
+}
+
ACE_STATIC_SVC_DEFINE (TAO_RT_Thread_Lane_Resources_Manager,
ACE_TEXT ("RT_Thread_Lane_Resources_Manager"),
ACE_SVC_OBJ_T,
diff --git a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.h b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.h
index f1014ef458e..86adcab04cb 100644
--- a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.h
+++ b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.h
@@ -22,6 +22,8 @@
#include "tao/Thread_Lane_Resources_Manager.h"
#include "ace/Service_Config.h"
+class TAO_Thread_Pool_Manager;
+
/**
* @class TAO_RT_Thread_Lane_Resources_Manager
*
@@ -43,8 +45,10 @@ public:
int open_default_resources (CORBA_Environment &ACE_TRY_ENV);
TAO_Thread_Lane_Resources &lane_resources (void);
-
TAO_Thread_Lane_Resources &default_lane_resources (void);
+ int shutdown_all_reactors (CORBA_Environment &ACE_TRY_ENV);
+
+protected:
/// Mutual exclusion for calling open.
TAO_SYNCH_MUTEX open_lock_;
@@ -54,8 +58,7 @@ public:
TAO_Thread_Lane_Resources *default_lane_resources_;
- /// ORB_Core related to this thread lane.
- TAO_ORB_Core *orb_core_;
+ TAO_Thread_Pool_Manager *tp_manager_;
};
ACE_STATIC_SVC_DECLARE_EXPORT (TAO_RTCORBA, TAO_RT_Thread_Lane_Resources_Manager)
diff --git a/TAO/tao/Reactor_Registry.cpp b/TAO/tao/Reactor_Registry.cpp
deleted file mode 100644
index b5867a2bbc3..00000000000
--- a/TAO/tao/Reactor_Registry.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// $Id$
-
-#include "tao/Reactor_Registry.h"
-#include "tao/ORB_Core.h"
-#include "tao/Leader_Follower.h"
-
-#if !defined (__ACE_INLINE__)
-# include "tao/Reactor_Registry.i"
-#endif /* ! __ACE_INLINE__ */
-
-ACE_RCSID(tao, Reactor_Registry, "$Id$")
-
-TAO_Reactor_Registry::TAO_Reactor_Registry (void)
- : orb_core_ (0)
- , lf_strategy_ (0)
-{
-}
-
-void
-TAO_Reactor_Registry::open (TAO_ORB_Core* orb_core)
-{
- this->orb_core_ = orb_core;
-
- this->lf_strategy_ = orb_core->resource_factory ()->create_lf_strategy ();
-}
-
-TAO_Reactor_Registry::~TAO_Reactor_Registry (void)
-{
- delete this->lf_strategy_;
-}
-
-
-TAO_LF_Strategy &
-TAO_Reactor_Registry::lf_strategy (void)
-{
- return *this->lf_strategy_;
-}
diff --git a/TAO/tao/Reactor_Registry.h b/TAO/tao/Reactor_Registry.h
deleted file mode 100644
index 3b877541b06..00000000000
--- a/TAO/tao/Reactor_Registry.h
+++ /dev/null
@@ -1,92 +0,0 @@
-
-//=============================================================================
-/**
- * @file Reactor_Registry.h
- *
- * $Id$
- *
- * @author Carlos O'Ryan (coryan@cs.wustl.edu)
- */
-//=============================================================================
-
-
-#ifndef TAO_REACTOR_REGISTRY_H
-#define TAO_REACTOR_REGISTRY_H
-#include "ace/pre.h"
-
-#include "tao/corbafwd.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-class TAO_ORB_Core;
-class TAO_Leader_Follower;
-class TAO_LF_Strategy;
-class TAO_Acceptor;
-class ACE_Reactor;
-
-/**
- * @class TAO_Reactor_Registry
- *
- * @brief The interface for the concurrency strategy.
- *
- * The ORB concurrency strategy is responsible for assigning
- * reactors to threads, keeping the relationship between threads
- * and their leader-follower groups and activating (if required)
- * the server-side Svc_Handlers.
- */
-class TAO_Export TAO_Reactor_Registry
-{
-public:
- /// Default constructor
- TAO_Reactor_Registry (void);
-
- /// The destructor
- virtual ~TAO_Reactor_Registry (void);
-
- /// The ORB core for this concurrency strategy.
- TAO_ORB_Core *orb_core (void) const;
-
- /// Initialize the Reactor Registry
- virtual void open (TAO_ORB_Core *orb_core);
-
- /// Return the reactor for the current thread
- virtual ACE_Reactor *reactor (void) = 0;
-
- /// Return the reactor for a given acceptor
- virtual ACE_Reactor *reactor (TAO_Acceptor *acceptor) = 0;
-
- /// Return the Leader-Follower group for the current thread
- virtual TAO_Leader_Follower &leader_follower (void) = 0;
-
- /// Return the leader follower strategy
- virtual TAO_LF_Strategy &lf_strategy (void);
-
- /// Return the Leader-Follower group for a given acceptor
- virtual TAO_Leader_Follower &leader_follower (TAO_Acceptor *acceptor) = 0;
-
- /**
- * The strategy is allowed to store TSS resources using a
- * place-holder in the ORB_Core class. The ORB_Core the calls back
- * to do the final cleanup.
- */
- virtual void destroy_tss_cookie (void* cookie) = 0;
-
- /// Wakeup all the reactors
- virtual int shutdown_all (void) = 0;
-
-private:
- /// The orb_core
- TAO_ORB_Core *orb_core_;
-
- /// The leader follower strategy
- TAO_LF_Strategy *lf_strategy_;
-};
-
-#if defined (__ACE_INLINE__)
-# include "tao/Reactor_Registry.i"
-#endif /* __ACE_INLINE__ */
-
-#include "ace/post.h"
-#endif /* TAO_REACTOR_REGISTRY_H */
diff --git a/TAO/tao/Reactor_Registry.i b/TAO/tao/Reactor_Registry.i
deleted file mode 100644
index 23578dce586..00000000000
--- a/TAO/tao/Reactor_Registry.i
+++ /dev/null
@@ -1,8 +0,0 @@
-// $Id$
-
-ACE_INLINE TAO_ORB_Core *
-TAO_Reactor_Registry::orb_core (void) const
-{
- return this->orb_core_;
-}
-
diff --git a/TAO/tao/Resource_Factory.cpp b/TAO/tao/Resource_Factory.cpp
index 43fca5817ff..5678a5fa4f2 100644
--- a/TAO/tao/Resource_Factory.cpp
+++ b/TAO/tao/Resource_Factory.cpp
@@ -65,12 +65,6 @@ TAO_Resource_Factory::use_locked_data_blocks (void) const
return 0;
}
-TAO_Reactor_Registry *
-TAO_Resource_Factory::get_reactor_registry (void)
-{
- return 0;
-}
-
ACE_Reactor *
TAO_Resource_Factory::get_reactor (void)
{
diff --git a/TAO/tao/Resource_Factory.h b/TAO/tao/Resource_Factory.h
index dc52a868ecb..a9a52303651 100644
--- a/TAO/tao/Resource_Factory.h
+++ b/TAO/tao/Resource_Factory.h
@@ -29,7 +29,6 @@
class TAO_Acceptor_Registry;
class TAO_Connector_Registry;
-class TAO_Reactor_Registry;
class TAO_Flushing_Strategy;
class TAO_Connection_Purging_Strategy;
@@ -125,10 +124,6 @@ public:
/// Locked_Data_Blocks
virtual int use_locked_data_blocks (void) const;
- /// Create the reactor holder, an strategy to control the number of
- /// reactors in the ORB
- virtual TAO_Reactor_Registry *get_reactor_registry (void);
-
/// Return an <ACE_Reactor> to be utilized.
virtual ACE_Reactor *get_reactor (void);
diff --git a/TAO/tao/Single_Reactor.cpp b/TAO/tao/Single_Reactor.cpp
deleted file mode 100644
index e6bad3c7da3..00000000000
--- a/TAO/tao/Single_Reactor.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-// $Id$
-
-#include "tao/Single_Reactor.h"
-#include "tao/ORB_Core.h"
-#include "tao/Resource_Factory.h"
-#include "tao/Leader_Follower.h"
-#include "tao/Thread_Lane_Resources.h"
-#include "ace/Reactor.h"
-
-#if !defined (__ACE_INLINE__)
-# include "tao/Single_Reactor.i"
-#endif /* ! __ACE_INLINE__ */
-
-ACE_RCSID(tao, Single_Reactor, "$Id$")
-
-TAO_Single_Reactor::TAO_Single_Reactor (void)
-{
-}
-
-TAO_Single_Reactor::~TAO_Single_Reactor (void)
-{
-}
-
-void
-TAO_Single_Reactor::open (TAO_ORB_Core *orb_core)
-{
- this->TAO_Reactor_Registry::open (orb_core);
-}
-
-ACE_Reactor *
-TAO_Single_Reactor::reactor (void)
-{
- return this->leader_follower ().reactor ();
-}
-
-ACE_Reactor *
-TAO_Single_Reactor::reactor (TAO_Acceptor *)
-{
- return this->reactor ();
-}
-
-TAO_Leader_Follower &
-TAO_Single_Reactor::leader_follower (void)
-{
- return this->orb_core ()->lane_resources ().leader_follower ();
-}
-
-TAO_Leader_Follower &
-TAO_Single_Reactor::leader_follower (TAO_Acceptor *)
-{
- return this->leader_follower ();
-}
-
-void
-TAO_Single_Reactor::destroy_tss_cookie (void*)
-{
-}
-
-int
-TAO_Single_Reactor::shutdown_all (void)
-{
- TAO_Leader_Follower &leader_follower =
- this->leader_follower ();
-
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
- ace_mon,
- leader_follower.lock (),
- -1);
-
- // Wakeup all the threads waiting blocked in the event loop, this
- // does not guarantee that they will all go away, but reduces the
- // load on the POA....
- ACE_Reactor *reactor =
- this->reactor ();
-
- reactor->wakeup_all_threads ();
-
- // If there are some client threads running we have to wait until
- // they finish, when the last one does it will shutdown the
- // reactor for us. Meanwhile no new requests will be accepted
- // because the POA will not process them.
-
- if (!leader_follower.has_clients ())
- {
- // Wake up all waiting threads in the reactor.
- reactor->end_reactor_event_loop ();
- }
-
- return 0;
-}
diff --git a/TAO/tao/Single_Reactor.h b/TAO/tao/Single_Reactor.h
deleted file mode 100644
index 96d925aa63d..00000000000
--- a/TAO/tao/Single_Reactor.h
+++ /dev/null
@@ -1,63 +0,0 @@
-
-//=============================================================================
-/**
- * @file Single_Reactor.h
- *
- * $Id$
- *
- * @author Carlos O'Ryan (coryan@cs.wustl.edu)
- */
-//=============================================================================
-
-
-#ifndef TAO_SINGLE_REACTOR_H
-#define TAO_SINGLE_REACTOR_H
-#include "ace/pre.h"
-
-#include "tao/Reactor_Registry.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-class TAO_Leader_Follower;
-
-/**
- * @class TAO_Single_Reactor
- *
- * @brief The Single_Reactor concurrency strategy.
- *
- * This strategy creates a different reactor for each priority
- * level, threads at the right priority level run the event loop
- * on that reactor.
- * Multiple threads can share the same reactor, usually using the
- * thread-pool strategy.
- */
-class TAO_Export TAO_Single_Reactor : public TAO_Reactor_Registry
-{
-public:
- /// Default constructor
- TAO_Single_Reactor (void);
-
- /// The destructor
- virtual ~TAO_Single_Reactor (void);
-
- // = The TAO_Reactor_Registry methods, please check the
- // documentation in tao/Reactor_Registry.h
- virtual void open (TAO_ORB_Core* orb_core);
- virtual ACE_Reactor *reactor (void);
- virtual ACE_Reactor *reactor (TAO_Acceptor *acceptor);
- virtual TAO_Leader_Follower &leader_follower (void);
- virtual TAO_Leader_Follower &leader_follower (TAO_Acceptor *acceptor);
- virtual void destroy_tss_cookie (void* cookie);
- virtual int shutdown_all (void);
-
-private:
-};
-
-#if defined (__ACE_INLINE__)
-# include "tao/Single_Reactor.i"
-#endif /* __ACE_INLINE__ */
-
-#include "ace/post.h"
-#endif /* TAO_SINGLE_REACTOR_H */
diff --git a/TAO/tao/Single_Reactor.i b/TAO/tao/Single_Reactor.i
deleted file mode 100644
index cfa1da318d3..00000000000
--- a/TAO/tao/Single_Reactor.i
+++ /dev/null
@@ -1 +0,0 @@
-// $Id$
diff --git a/TAO/tao/Strategies/Reactor_Per_Priority.cpp b/TAO/tao/Strategies/Reactor_Per_Priority.cpp
deleted file mode 100644
index c94fd71c315..00000000000
--- a/TAO/tao/Strategies/Reactor_Per_Priority.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-// $Id$
-
-#include "Reactor_Per_Priority.h"
-#include "tao/ORB_Core.h"
-#include "tao/Resource_Factory.h"
-#include "tao/Leader_Follower.h"
-#include "tao/Pluggable.h"
-#include "tao/debug.h"
-#include "ace/Reactor.h"
-
-#if !defined (__ACE_INLINE__)
-# include "Reactor_Per_Priority.i"
-#endif /* ! __ACE_INLINE__ */
-
-ACE_RCSID(Strategies, Reactor_Per_Priority, "$Id$")
-
-TAO_Reactor_Per_Priority::~TAO_Reactor_Per_Priority (void)
-{
- for (Map_Iterator i = this->map_.begin ();
- i != this->map_.end ();
- ++i)
- {
- delete (*i).int_id_;
- }
-}
-
-ACE_Reactor *
-TAO_Reactor_Per_Priority::reactor (void)
-{
- ACE_DECLARE_NEW_CORBA_ENV;
-
- TAO_ORB_Core_TSS_Resources *tss =
- this->orb_core ()->get_tss_resources ();
-
- TAO_Leader_Follower *leader_follower =
- ACE_static_cast (TAO_Leader_Follower*,
- tss->reactor_registry_cookie_);
-
- if (leader_follower != 0)
- return leader_follower->reactor ();
-
- TAO_Protocols_Hooks *tph =
- this->orb_core ()->get_protocols_hooks (ACE_TRY_ENV);
- ACE_CHECK_RETURN (0);
-
- CORBA::Short priority = 0;
- if (tph->get_thread_priority (priority,
- ACE_TRY_ENV)
- == -1)
- {
- if (TAO_debug_level > 3)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) - Reactor_Per_Priority::reactor: ")
- ACE_TEXT (" cannot get priority for this thread\n")));
- return 0;
- }
-
- leader_follower = this->leader_follower_i (priority);
-
- return leader_follower->reactor ();
-}
-
-ACE_Reactor *
-TAO_Reactor_Per_Priority::reactor (TAO_Acceptor *acceptor)
-{
- //
- // Here is the explanation for going from CORBA priority to Native
- // and back again:
- //
- // Suppose the user specifies 20,000 as the (CORBA) priority for a
- // endpoint. 20,000 will be mapped to the native priority (say 10)
- // when the thread is created. When the thread goes to access it's
- // reactor, the native priority will be converted to the CORBA
- // priority (say 19,000) which is used to look up the reactor.
- // There is a loss of precision in this conversion.
- //
- // We use the same two step normalization here. Otherwise, we'll
- // get a reactor which is different than the one used by the
- // endpoint thread(s).
-
- CORBA::Short normalized_corba_priority = 0;
- CORBA::Short user_specified_corba_priority =
- acceptor->priority ();
-
- TAO_CORBA_Priority_Normalizer *corba_priority_normalizer =
- this->orb_core ()->corba_priority_normalizer ();
-
- CORBA::Boolean result =
- corba_priority_normalizer->normalize (user_specified_corba_priority,
- normalized_corba_priority);
- if (result == 0)
- return 0;
-
- TAO_Leader_Follower *leader_follower =
- this->leader_follower_i (normalized_corba_priority);
-
- return leader_follower->reactor ();
-}
-
-TAO_Leader_Follower &
-TAO_Reactor_Per_Priority::leader_follower (void)
-{
- ACE_DECLARE_NEW_CORBA_ENV;
-
- TAO_ORB_Core_TSS_Resources *tss =
- this->orb_core ()->get_tss_resources ();
-
- TAO_Leader_Follower *leader_follower =
- ACE_static_cast (TAO_Leader_Follower*,
- tss->reactor_registry_cookie_);
-
- if (leader_follower != 0)
- return *leader_follower;
-
- TAO_Protocols_Hooks *tph =
- this->orb_core ()->get_protocols_hooks (ACE_TRY_ENV);
- ACE_CHECK_RETURN (*leader_follower);
-
- CORBA::Short priority = 0;
- if (tph->get_thread_priority (priority,
- ACE_TRY_ENV)
- == -1)
- return *leader_follower;
-
- return *this->leader_follower_i (priority);
-}
-
-TAO_Leader_Follower &
-TAO_Reactor_Per_Priority::leader_follower (TAO_Acceptor *acceptor)
-{
- CORBA::Short priority =
- acceptor->priority ();
-
- return *this->leader_follower_i (priority);
-}
-
-void
-TAO_Reactor_Per_Priority::destroy_tss_cookie (void*)
-{
- // Do nothing, data is destroyed in the map...
-}
-
-TAO_Leader_Follower *
-TAO_Reactor_Per_Priority::leader_follower_i (CORBA::Short priority)
-{
- // If the priority of the current thread is not right we return.
- TAO_Leader_Follower *leader_follower = 0;
- if (this->map_.find (priority, leader_follower) == -1)
- {
- if (TAO_debug_level > 3)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) - new priority %d\n"),
- priority));
- // The priority is new, create an entry in the table.
- ACE_NEW_RETURN (leader_follower,
- TAO_Leader_Follower (this->orb_core ()),
- leader_follower);
- this->map_.bind (priority, leader_follower);
- }
-
- return leader_follower;
-}
-
-int
-TAO_Reactor_Per_Priority::shutdown_all (void)
-{
- for (Map_Iterator i = this->map_.begin ();
- i != this->map_.end ();
- ++i)
- {
- TAO_Leader_Follower &leader_follower =
- *((*i).int_id_);
-
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
- ace_mon,
- leader_follower.lock (),
- -1);
-
- // Wakeup all the threads waiting blocked in the event loop,
- // this does not guarantee that they will all go away, but
- // reduces the load on the POA....
- ACE_Reactor *reactor =
- leader_follower.reactor ();
-
- reactor->wakeup_all_threads ();
-
- // If there are some client threads running we have to wait
- // until they finish, when the last one does it will shutdown
- // the reactor for us. Meanwhile no new requests will be
- // accepted because the POA will not process them.
-
- if (!leader_follower.has_clients ())
- {
- // Wake up all waiting threads in the reactor.
- reactor->end_reactor_event_loop ();
- }
- }
-
- return 0;
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-
-template class ACE_Map_Manager<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>;
-template class ACE_Map_Iterator<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>;
-template class ACE_Map_Iterator_Base<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>;
-template class ACE_Map_Reverse_Iterator<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>;
-template class ACE_Map_Entry<CORBA::Short,TAO_Leader_Follower*>;
-
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-
-#pragma instantiate ACE_Map_Manager<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>
-#pragma instantiate ACE_Map_Iterator<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>
-#pragma instantiate ACE_Map_Iterator_Base<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>
-#pragma instantiate ACE_Map_Reverse_Iterator<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX>
-#pragma instantiate ACE_Map_Entry<CORBA::Short,TAO_Leader_Follower*>
-
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/tao/Strategies/Reactor_Per_Priority.h b/TAO/tao/Strategies/Reactor_Per_Priority.h
deleted file mode 100644
index 50a4e209b1b..00000000000
--- a/TAO/tao/Strategies/Reactor_Per_Priority.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO
-//
-// = FILENAME
-// Reactor_Per_Priority.h
-//
-// = AUTHOR
-// Carlos O'Ryan (coryan@cs.wustl.edu)
-//
-// ============================================================================
-
-#ifndef TAO_REACTOR_PER_PRIORITY_H
-#define TAO_REACTOR_PER_PRIORITY_H
-#include "ace/pre.h"
-
-#include "tao/Reactor_Registry.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "strategies_export.h"
-#include "ace/Map_Manager.h"
-
-class TAO_Leader_Follower;
-
-class TAO_Strategies_Export TAO_Reactor_Per_Priority : public TAO_Reactor_Registry
-{
- // = TITLE
- // The Reactor_Per_Priority concurrency strategy.
- //
- // = DESCRIPTION
- // This strategy creates a different reactor for each priority
- // level, threads at the right priority level run the event loop
- // on that reactor.
- // Multiple threads can share the same reactor, usually using the
- // thread-pool strategy.
- //
-public:
- TAO_Reactor_Per_Priority (void);
- // Default constructor
-
- virtual ~TAO_Reactor_Per_Priority (void);
- // The destructor
-
- // = The TAO_Reactor_Registry methods, please check the
- // documentation in tao/Reactor_Registry.h
- virtual ACE_Reactor *reactor (void);
- virtual ACE_Reactor *reactor (TAO_Acceptor *acceptor);
- virtual TAO_Leader_Follower &leader_follower (void);
- virtual TAO_Leader_Follower &leader_follower (TAO_Acceptor *acceptor);
- virtual void destroy_tss_cookie (void* cookie);
- virtual int shutdown_all (void);
-
-private:
- TAO_Leader_Follower *leader_follower_i (CORBA::Short priority);
- // Obtain the leader follower object given a priority, used to
- // implement all the other methods
-
-private:
- typedef ACE_Map_Manager<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX> Map;
- typedef ACE_Map_Iterator<CORBA::Short,TAO_Leader_Follower*,TAO_SYNCH_MUTEX> Map_Iterator;
-
- Map map_;
- // The map between priorities and the control structure for the
- // reactor
-};
-
-#if defined (__ACE_INLINE__)
-# include "Reactor_Per_Priority.i"
-#endif /* __ACE_INLINE__ */
-
-#include "ace/post.h"
-#endif /* TAO_REACTOR_PER_PRIORITY_H */
diff --git a/TAO/tao/Strategies/Reactor_Per_Priority.i b/TAO/tao/Strategies/Reactor_Per_Priority.i
deleted file mode 100644
index 86c085d631a..00000000000
--- a/TAO/tao/Strategies/Reactor_Per_Priority.i
+++ /dev/null
@@ -1,6 +0,0 @@
-// $Id$
-
-ACE_INLINE
-TAO_Reactor_Per_Priority::TAO_Reactor_Per_Priority (void)
-{
-}
diff --git a/TAO/tao/Strategies/TAO_Strategies.dsp b/TAO/tao/Strategies/TAO_Strategies.dsp
index 3b836f5bd2e..c5c684082cb 100644
--- a/TAO/tao/Strategies/TAO_Strategies.dsp
+++ b/TAO/tao/Strategies/TAO_Strategies.dsp
@@ -118,10 +118,6 @@ SOURCE=.\NULL_Connection_Purging_Strategy.cpp
# End Source File
# Begin Source File
-SOURCE=.\Reactor_Per_Priority.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\SHMIOP_Acceptor.cpp
# End Source File
# Begin Source File
@@ -206,10 +202,6 @@ SOURCE=.\GIOP_Message_NonReactive_Handler.h
# End Source File
# Begin Source File
-SOURCE=.\Reactor_Per_Priority.h
-# End Source File
-# Begin Source File
-
SOURCE=.\SHMIOP_Acceptor.h
# End Source File
# Begin Source File
@@ -242,10 +234,6 @@ SOURCE=.\SHMIOP_Transport.h
# End Source File
# Begin Source File
-SOURCE=.\Single_Reactor.h
-# End Source File
-# Begin Source File
-
SOURCE=.\strategies_export.h
# End Source File
# Begin Source File
@@ -310,10 +298,6 @@ SOURCE=.\GIOP_Message_NonReactive_Handler.inl
# End Source File
# Begin Source File
-SOURCE=.\Reactor_Per_Priority.i
-# End Source File
-# Begin Source File
-
SOURCE=.\SHMIOP_Acceptor.i
# End Source File
# Begin Source File
@@ -338,10 +322,6 @@ SOURCE=.\SHMIOP_Transport.i
# End Source File
# Begin Source File
-SOURCE=.\Single_Reactor.i
-# End Source File
-# Begin Source File
-
SOURCE=.\UIOP_Connect.i
# End Source File
# Begin Source File
diff --git a/TAO/tao/Strategies/advanced_resource.cpp b/TAO/tao/Strategies/advanced_resource.cpp
index c590e862fec..1f2d8b20d22 100644
--- a/TAO/tao/Strategies/advanced_resource.cpp
+++ b/TAO/tao/Strategies/advanced_resource.cpp
@@ -9,13 +9,11 @@
#include "UIOP_Factory.h"
#include "SHMIOP_Factory.h"
-#include "Reactor_Per_Priority.h"
#include "LFU_Connection_Purging_Strategy.h"
#include "FIFO_Connection_Purging_Strategy.h"
#include "NULL_Connection_Purging_Strategy.h"
#include "tao/debug.h"
-#include "tao/Single_Reactor.h"
#include "tao/LRU_Connection_Purging_Strategy.h"
#include "tao/Leader_Follower.h"
@@ -47,9 +45,8 @@ TAO_Resource_Factory_Changer::TAO_Resource_Factory_Changer (void)
}
TAO_Advanced_Resource_Factory::TAO_Advanced_Resource_Factory (void)
- :reactor_registry_type_ (TAO_SINGLE_REACTOR),
- reactor_type_ (TAO_REACTOR_TP),
- cdr_allocator_type_ (TAO_ALLOCATOR_THREAD_LOCK)
+ : reactor_type_ (TAO_REACTOR_TP),
+ cdr_allocator_type_ (TAO_ALLOCATOR_THREAD_LOCK)
{
// Constructor
}
@@ -68,29 +65,7 @@ TAO_Advanced_Resource_Factory::init (int argc, char **argv)
for (curarg = 0; curarg < argc; curarg++)
if (ACE_OS::strcasecmp (argv[curarg],
- "-ORBReactorRegistry") == 0)
- {
-
- curarg++;
- if (curarg < argc)
- {
- char *name = argv[curarg];
-
- if (ACE_OS::strcasecmp (name,
- "single") == 0)
- this->reactor_registry_type_ = TAO_SINGLE_REACTOR;
- else if (ACE_OS::strcasecmp (name,
- "per-priority") == 0)
- this->reactor_registry_type_ = TAO_REACTOR_PER_PRIORITY;
- else
- ACE_DEBUG((LM_DEBUG,
- ACE_TEXT ("TAO_Default_Factory - unknown argument")
- ACE_TEXT (" <%s> for -ORBReactorRegistry\n"), name));
- }
- }
-
- else if (ACE_OS::strcasecmp (argv[curarg],
- "-ORBReactorLock") == 0)
+ "-ORBReactorLock") == 0)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("TAO_Default_Resource obsolete -ORBReactorLock ")
@@ -403,31 +378,7 @@ TAO_Advanced_Resource_Factory::get_protocol_factories (void)
return &protocol_factories_;
}
-TAO_Reactor_Registry *
-TAO_Advanced_Resource_Factory::get_reactor_registry (void)
-{
- TAO_Reactor_Registry *reactor_registry = 0;
- switch (this->reactor_registry_type_)
- {
- default:
- case TAO_SINGLE_REACTOR:
- ACE_NEW_RETURN (reactor_registry,
- TAO_Single_Reactor,
- 0);
- break;
-
- case TAO_REACTOR_PER_PRIORITY:
- ACE_NEW_RETURN (reactor_registry,
- TAO_Reactor_Per_Priority,
- 0);
- break;
-
- }
-
- return reactor_registry;
-}
-
-ACE_Reactor_Impl*
+ACE_Reactor_Impl *
TAO_Advanced_Resource_Factory::allocate_reactor_impl (void) const
{
ACE_Reactor_Impl *impl = 0;
diff --git a/TAO/tao/Strategies/advanced_resource.h b/TAO/tao/Strategies/advanced_resource.h
index 0d06565778e..263bdcf95c8 100644
--- a/TAO/tao/Strategies/advanced_resource.h
+++ b/TAO/tao/Strategies/advanced_resource.h
@@ -64,15 +64,7 @@ public:
TAO_REACTOR_TP
};
- // = Reactor mappings strategy
- enum
- {
- TAO_SINGLE_REACTOR,
- TAO_REACTOR_PER_PRIORITY
- };
-
// = Resource Retrieval
- virtual TAO_Reactor_Registry *get_reactor_registry (void);
virtual int init_protocol_factories (void);
virtual ACE_Allocator* input_cdr_dblock_allocator (void);
virtual ACE_Allocator* input_cdr_buffer_allocator (void);
diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp
index ec3d2f86b72..d764f66c0d6 100644
--- a/TAO/tao/TAO.dsp
+++ b/TAO/tao/TAO.dsp
@@ -687,10 +687,6 @@ SOURCE=.\Reactive_Flushing_Strategy.cpp
# End Source File
# Begin Source File
-SOURCE=.\Reactor_Registry.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\Remote_Object_Proxy_Broker.cpp
# End Source File
# Begin Source File
@@ -735,10 +731,6 @@ SOURCE=.\Services_Activate.cpp
# End Source File
# Begin Source File
-SOURCE=.\Single_Reactor.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\skip.cpp
# End Source File
# Begin Source File
@@ -1479,10 +1471,6 @@ SOURCE=.\Reactive_Flushing_Strategy.h
# End Source File
# Begin Source File
-SOURCE=.\Reactor_Registry.h
-# End Source File
-# Begin Source File
-
SOURCE=.\Remote_Object_Proxy_Broker.h
# End Source File
# Begin Source File
@@ -1531,10 +1519,6 @@ SOURCE=.\Services_Activate.h
# End Source File
# Begin Source File
-SOURCE=.\Single_Reactor.h
-# End Source File
-# Begin Source File
-
SOURCE=.\singletons.h
# End Source File
# Begin Source File
@@ -2119,10 +2103,6 @@ SOURCE=.\Profile.i
# End Source File
# Begin Source File
-SOURCE=.\Reactor_Registry.i
-# End Source File
-# Begin Source File
-
SOURCE=.\Reply_Dispatcher.i
# End Source File
# Begin Source File
@@ -2147,10 +2127,6 @@ SOURCE=.\Services.i
# End Source File
# Begin Source File
-SOURCE=.\Single_Reactor.i
-# End Source File
-# Begin Source File
-
SOURCE=.\StringSeqC.i
# End Source File
# Begin Source File
diff --git a/TAO/tao/Thread_Lane_Resources.cpp b/TAO/tao/Thread_Lane_Resources.cpp
index bb431787676..1e824a716ae 100644
--- a/TAO/tao/Thread_Lane_Resources.cpp
+++ b/TAO/tao/Thread_Lane_Resources.cpp
@@ -27,8 +27,6 @@ TAO_Thread_Lane_Resources::TAO_Thread_Lane_Resources (TAO_ORB_Core &orb_core)
TAO_Thread_Lane_Resources::~TAO_Thread_Lane_Resources (void)
{
- delete this->transport_cache_;
- delete this->leader_follower_;
}
TAO_Transport_Cache_Manager &
@@ -139,4 +137,7 @@ TAO_Thread_Lane_Resources::finalize (void)
ACE_Event_Handler::ALL_EVENTS_MASK);
}
}
+
+ delete this->transport_cache_;
+ delete this->leader_follower_;
}
diff --git a/TAO/tao/Thread_Lane_Resources_Manager.cpp b/TAO/tao/Thread_Lane_Resources_Manager.cpp
index 5148438f45b..8cbb144d083 100644
--- a/TAO/tao/Thread_Lane_Resources_Manager.cpp
+++ b/TAO/tao/Thread_Lane_Resources_Manager.cpp
@@ -1,6 +1,7 @@
// $Id$
#include "tao/Thread_Lane_Resources_Manager.h"
+#include "tao/Leader_Follower.h"
ACE_RCSID(tao, Thread_Lane_Resources_Manager, "$Id$")
@@ -8,8 +9,33 @@ ACE_RCSID(tao, Thread_Lane_Resources_Manager, "$Id$")
# include "tao/Thread_Lane_Resources_Manager.i"
#endif /* ! __ACE_INLINE__ */
+TAO_Thread_Lane_Resources_Manager::TAO_Thread_Lane_Resources_Manager (void)
+ : orb_core_ (0),
+ lf_strategy_ (0)
+{
+}
+
TAO_Thread_Lane_Resources_Manager::~TAO_Thread_Lane_Resources_Manager (void)
{
+ delete this->lf_strategy_;
+}
+
+int
+TAO_Thread_Lane_Resources_Manager::initialize (TAO_ORB_Core &orb_core)
+{
+ this->orb_core_ =
+ &orb_core;
+
+ this->lf_strategy_ =
+ this->orb_core_->resource_factory ()->create_lf_strategy ();
+
+ return 0;
+}
+
+TAO_LF_Strategy &
+TAO_Thread_Lane_Resources_Manager::lf_strategy (void)
+{
+ return *this->lf_strategy_;
}
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
diff --git a/TAO/tao/Thread_Lane_Resources_Manager.h b/TAO/tao/Thread_Lane_Resources_Manager.h
index 45522d596b4..0e8d1ab58f4 100644
--- a/TAO/tao/Thread_Lane_Resources_Manager.h
+++ b/TAO/tao/Thread_Lane_Resources_Manager.h
@@ -23,6 +23,7 @@
class TAO_ORB_Core;
class TAO_Thread_Lane_Resources;
+class TAO_LF_Strategy;
/**
* @class TAO_Thread_Lane_Resources_Manager
@@ -33,15 +34,28 @@ class TAO_Export TAO_Thread_Lane_Resources_Manager
: public ACE_Service_Object
{
public:
+ TAO_Thread_Lane_Resources_Manager (void);
virtual ~TAO_Thread_Lane_Resources_Manager (void);
- virtual int initialize (TAO_ORB_Core &orb_core) = 0;
+ virtual int initialize (TAO_ORB_Core &orb_core);
virtual void finalize (void) = 0;
virtual int open_default_resources (CORBA_Environment &ACE_TRY_ENV) = 0;
virtual TAO_Thread_Lane_Resources &lane_resources (void) = 0;
virtual TAO_Thread_Lane_Resources &default_lane_resources (void) = 0;
+
+ virtual int shutdown_all_reactors (CORBA_Environment &ACE_TRY_ENV) = 0;
+
+ /// Return the leader follower strategy
+ TAO_LF_Strategy &lf_strategy (void);
+
+protected:
+ /// The ORB Core.
+ TAO_ORB_Core *orb_core_;
+
+ /// The leader follower strategy
+ TAO_LF_Strategy *lf_strategy_;
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index 521e6fc8218..15800d30e9e 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -8,7 +8,6 @@
#include "tao/Acceptor_Registry.h"
#include "tao/Connector_Registry.h"
-#include "tao/Single_Reactor.h"
#include "tao/Reactive_Flushing_Strategy.h"
#include "tao/Block_Flushing_Strategy.h"
@@ -625,7 +624,7 @@ TAO_Default_Resource_Factory::get_protocol_factories (void)
return &protocol_factories_;
}
-TAO_Acceptor_Registry*
+TAO_Acceptor_Registry *
TAO_Default_Resource_Factory::get_acceptor_registry (void)
{
TAO_Acceptor_Registry *ar = 0;
@@ -637,7 +636,7 @@ TAO_Default_Resource_Factory::get_acceptor_registry (void)
return ar;
}
-TAO_Connector_Registry*
+TAO_Connector_Registry *
TAO_Default_Resource_Factory::get_connector_registry (void)
{
TAO_Connector_Registry *cr = 0;
@@ -649,17 +648,6 @@ TAO_Default_Resource_Factory::get_connector_registry (void)
return cr;
}
-TAO_Reactor_Registry *
-TAO_Default_Resource_Factory::get_reactor_registry (void)
-{
- TAO_Reactor_Registry *reactor_registry = 0;
-
- ACE_NEW_RETURN (reactor_registry,
- TAO_Single_Reactor,
- 0);
- return reactor_registry;
-}
-
ACE_Reactor_Impl*
TAO_Default_Resource_Factory::allocate_reactor_impl (void) const
{
diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h
index 736fff7b574..a09fdfa6223 100644
--- a/TAO/tao/default_resource.h
+++ b/TAO/tao/default_resource.h
@@ -63,20 +63,12 @@ public:
TAO_ALLOCATOR_THREAD_LOCK
};
- // = Reactor mappings strategy
- enum
- {
- TAO_SINGLE_REACTOR,
- TAO_REACTOR_PER_PRIORITY
- };
-
/// Modify and get the source for the CDR allocators
int cdr_allocator_source (void);
// = Resource Retrieval
virtual int use_tss_resources (void) const;
virtual int use_locked_data_blocks (void) const;
- virtual TAO_Reactor_Registry *get_reactor_registry (void);
virtual ACE_Reactor *get_reactor (void);
virtual void reclaim_reactor (ACE_Reactor *);
virtual TAO_Acceptor_Registry *get_acceptor_registry (void);