summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-26 22:54:21 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-26 22:54:21 +0000
commit6926ec2f65f4cba3e1508bbc55e92c44b0ca70fe (patch)
tree899167c645db58dec9366c167b0835377b4ec739
parent6c1c62ec06a628fa6aaf4f6fad22b4f9a6e94262 (diff)
downloadATCD-6926ec2f65f4cba3e1508bbc55e92c44b0ca70fe.tar.gz
Wed Aug 26 17:00:38 1998 Nanbor Wang <nanbor@cs.wustl.edu>
-rw-r--r--TAO/tao/Environment.cpp28
-rw-r--r--TAO/tao/ORB_Core.cpp39
-rw-r--r--TAO/tao/ORB_Core.h10
-rw-r--r--TAO/tao/orbconf.h4
4 files changed, 74 insertions, 7 deletions
diff --git a/TAO/tao/Environment.cpp b/TAO/tao/Environment.cpp
index 57914f2c97c..8dea3abfc62 100644
--- a/TAO/tao/Environment.cpp
+++ b/TAO/tao/Environment.cpp
@@ -8,6 +8,7 @@
ACE_RCSID(tao, Environment, "$Id$")
+#if 0
CORBA_Environment::CORBA_Environment (void)
: exception_ (0),
previous_ (TAO_ORB_Core_instance ()->default_environment ())
@@ -15,21 +16,44 @@ CORBA_Environment::CORBA_Environment (void)
TAO_ORB_Core_instance ()->default_environment (this);
}
+CORBA_Environment::CORBA_Environment (const CORBA_Environment& rhs)
+ : exception_ (rhs.exception_),
+ previous_ (TAO_ORB_Core_instance ()->default_environment ())
+{
+ TAO_ORB_Core_instance ()->default_environment (this);
+ exception_->_incr_refcnt ();
+}
+
CORBA_Environment::CORBA_Environment (TAO_ORB_Core* orb_core)
: exception_ (0),
previous_ (orb_core->default_environment ())
{
orb_core->default_environment (this);
}
+#else
+CORBA_Environment::CORBA_Environment (void)
+ : exception_ (0),
+ previous_ (0)
+{
+ // TAO_ORB_Core_instance ()->default_environment (this);
+}
CORBA_Environment::CORBA_Environment (const CORBA_Environment& rhs)
: exception_ (rhs.exception_),
- previous_ (TAO_ORB_Core_instance ()->default_environment ())
+ previous_ (0)
{
- TAO_ORB_Core_instance ()->default_environment (this);
+ // TAO_ORB_Core_instance ()->default_environment (this);
exception_->_incr_refcnt ();
}
+CORBA_Environment::CORBA_Environment (TAO_ORB_Core* orb_core)
+ : exception_ (0),
+ previous_ (0)
+{
+ // orb_core->default_environment (this);
+}
+#endif
+
CORBA_Environment&
CORBA_Environment::operator= (const CORBA_Environment& rhs)
{
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index e30c513a5e9..8f69a1120f3 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -83,8 +83,11 @@ TAO_ORB_Core::~TAO_ORB_Core (void)
this->cdr_buffer_allocator_.remove ();
}
-TAO_Default_Reactor::TAO_Default_Reactor (void)
- : ACE_Reactor (new TAO_REACTOR, 1)
+TAO_Default_Reactor::TAO_Default_Reactor (int nolock)
+ : ACE_Reactor ((nolock ?
+ (ACE_Reactor_Impl*) new TAO_NULL_LOCK_REACTOR :
+ (ACE_Reactor_Impl*) new TAO_REACTOR),
+ 1)
{
}
@@ -1077,7 +1080,8 @@ TAO_ORB_Core::get_next_follower (void)
TAO_Resource_Factory::TAO_Resource_Factory (void)
: resource_source_ (TAO_GLOBAL),
poa_source_ (TAO_GLOBAL),
- collocation_table_source_ (TAO_GLOBAL)
+ collocation_table_source_ (TAO_GLOBAL),
+ use_lock_freed_reactor_ (0)
{
}
@@ -1110,6 +1114,12 @@ TAO_Resource_Factory::poa_source (void)
}
int
+TAO_Resource_Factory::use_lock_freed_reactor (void)
+{
+ return use_lock_freed_reactor_;
+}
+
+int
TAO_Resource_Factory::init (int argc, char *argv[])
{
return this->parse_args (argc, argv);
@@ -1167,6 +1177,19 @@ TAO_Resource_Factory::parse_args (int argc, char **argv)
local_poa_source = TAO_TSS;
}
}
+ else if (ACE_OS::strcmp (argv[curarg], "-ORBlockfreedreactor") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ char *name = argv[curarg];
+
+ if (ACE_OS::strcasecmp (name, "yes") == 0)
+ use_lock_freed_reactor_ = 1;
+ else if (ACE_OS::strcasecmp (name, "no") == 0)
+ use_lock_freed_reactor_= 0;
+ }
+ }
else if (ACE_OS::strcmp (argv[curarg], "-ORBcoltable") == 0)
{
curarg++;
@@ -1319,6 +1342,7 @@ TAO_Resource_Factory::get_global_collocation_table (void)
}
TAO_Resource_Factory::Pre_Allocated::Pre_Allocated (void)
+ : r_ (TAO_ORB_CORE::instance ()->resource_factory ()->use_lock_freed_reactor ())
{
// Make sure that the thread manager does not wait for threads
this->tm_.wait_on_exit (0);
@@ -1394,6 +1418,10 @@ template class ACE_Node<ACE_SYNCH_CONDITION*>;
template class ACE_Unbounded_Set<ACE_SYNCH_CONDITION*>;
template class ACE_Unbounded_Set_Iterator<ACE_SYNCH_CONDITION*>;
+#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE == 0)
+template class ACE_Select_Reactor_Token_T<ACE_Noop_Token>;
+template class ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T<ACE_Noop_Token> >;
+#endif /* !ACE_MT_SAFE || ACE_MT_SAFE == 0 */
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
#pragma instantiate ACE_Env_Value<int>
@@ -1439,6 +1467,11 @@ template class ACE_Unbounded_Set_Iterator<ACE_SYNCH_CONDITION*>;
#pragma instantiate ACE_Node<ACE_SYNCH_CONDITION*>
#pragma instantiate ACE_Unbounded_Set<ACE_SYNCH_CONDITION*>
#pragma instantiate ACE_Unbounded_Set_Iterator<ACE_SYNCH_CONDITION*>
+
+#if !defined (ACE_MT_SAFE) || (ACE_MT_SAFE == 0)
+# pragma instantiate ACE_Select_Reactor_Token_T<ACE_Noop_Token>
+# pragma instantiate ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T<ACE_Noop_Token> >
+#endif /* !ACE_MT_SAFE || ACE_MT_SAFE == 0 */
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
ACE_FACTORY_DEFINE (TAO, TAO_Resource_Factory)
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index aae6025ac86..f85ade96f17 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -360,7 +360,7 @@ class TAO_Default_Reactor : public ACE_Reactor
//
// Force TAO to use Select Reactor.
public:
- TAO_Default_Reactor (void);
+ TAO_Default_Reactor (int nolock = 0);
virtual ~TAO_Default_Reactor (void);
};
@@ -378,7 +378,7 @@ class TAO_Export TAO_Resource_Factory : public ACE_Service_Object
public:
// = Initialization and termination methods.
- TAO_Resource_Factory (void);
+ TAO_Resource_Factory ();
virtual ~TAO_Resource_Factory (void);
// = Service Configurator hooks.
@@ -483,6 +483,8 @@ public:
// created in application space by <CORBA::ORB_init()>, but needs to
// be available to stubs and generated code.
+ virtual int use_lock_freed_reactor (void);
+
// @@ I suspect that putting these structs inside of this class is
// going to break some compilers (e.g., HP/YUX) when you try to use
// this stuff with the ACE_Singletons below. I suggest you move
@@ -572,6 +574,10 @@ protected:
// thread-specific. It defaults to TAO_GLOBAL if not set
// specifically.
+ int use_lock_freed_reactor_;
+ // Flag indicating wether we should provide a lock-freed reactor
+ // or not.
+
// = Typedefs for the singleton types used to store our orb core
// information.
typedef ACE_Singleton<Pre_Allocated, ACE_SYNCH_MUTEX>
diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h
index ed2e0802055..c6266d4c919 100644
--- a/TAO/tao/orbconf.h
+++ b/TAO/tao/orbconf.h
@@ -29,6 +29,10 @@
#define TAO_REACTOR ACE_Select_Reactor
#endif /* TAO_REACTOR */
+#if !defined (TAO_NULL_LOCK_REACTOR)
+#define TAO_NULL_LOCK_REACTOR ACE_Select_Reactor_T< ACE_Select_Reactor_Token_T<ACE_Noop_Token> >
+#endif /* TAO_NULL_LOCK_REACTOR */
+
// Users should override this stuff if they don't want to use the
// default ACE Socket wrappers. This makes it possible to change
// TAO's transport mechanism wholesale by making a few minor changes