summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-04-16 17:57:35 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-04-16 17:57:35 +0000
commit20ed9d12258ba5250f0bd27c374a1836ec9678cc (patch)
treec38dbd5e8836b7f1cc210a61c5228e8b9fd587ed /TAO/orbsvcs
parent6e3819d1ab25897551c493f7481007f4b7e8dabc (diff)
downloadATCD-20ed9d12258ba5250f0bd27c374a1836ec9678cc.tar.gz
ChangeLogTag: Wed Apr 16 13:44:47 2003 Irfan Pyarali <irfan@oomworks.com>
Diffstat (limited to 'TAO/orbsvcs')
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp90
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h3
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.cpp2
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Properties.h12
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp6
5 files changed, 14 insertions, 99 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
index 43c8677ffc0..1e0a7cccacd 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp
@@ -91,7 +91,7 @@ TAO_CosNotify_Service::init (int argc, char *argv[])
properties->asynch_updates (1);
}
- else if (arg_shifter.cur_arg_strncasecmp (ACE_LIB_TEXT("-AllocateTaskperProxy")) == 0)
+ else if (arg_shifter.cur_arg_strncasecmp (ACE_LIB_TEXT("-AllocateTaskperProxy")) == 0)
{
task_per_proxy = 1;
arg_shifter.consume_arg ();
@@ -170,10 +170,6 @@ TAO_CosNotify_Service::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
void
TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
{
- /// first, init the main thread.
- //this->init_main_thread (orb ACE_ENV_ARG_PARAMETER);
- //ACE_CHECK;
-
// Obtain the Root POA
CORBA::Object_var object =
orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
@@ -181,89 +177,23 @@ TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL)
if (CORBA::is_nil (object.in ()))
ACE_ERROR ((LM_ERROR,
- " (%P|%t) Unable to resolve the RootPOA.\n"));
+ " (%P|%t) Unable to resolve the RootPOA.\n"));
PortableServer::POA_var default_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
/// Set the properties
- TAO_NS_Properties* properties = TAO_NS_PROPERTIES::instance();
-
- properties->orb (orb);
- properties->default_poa (default_poa.in ());
- properties->sched_policy (orb->orb_core ()->orb_params ()->sched_policy ());
- properties->scope_policy (orb->orb_core ()->orb_params ()->scope_policy ());
-
- // Init the factory
- this->init_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
-
- this->init_builder (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
-}
-
-void
-TAO_CosNotify_Service::init_main_thread (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL_NOT_USED)
-{
- ACE_Sched_Params::Policy sched_policy;
- long thr_sched_policy = orb->orb_core ()->orb_params ()->sched_policy ();
-
- //long thr_scope_policy = orb->orb_core ()->orb_params ()->scope_policy ();
-
- if (thr_sched_policy == THR_SCHED_FIFO)
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_FIFO\n"));
-
- sched_policy = ACE_SCHED_FIFO;
- }
- else if (thr_sched_policy == THR_SCHED_RR)
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_RR\n"));
-
- sched_policy = ACE_SCHED_RR;
- }
- else
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_OTHER\n"));
-
- sched_policy = ACE_SCHED_OTHER;
- }
+ TAO_NS_Properties* properties = TAO_NS_PROPERTIES::instance();
- /// Check sched.
- int min_priority = ACE_Sched_Params::priority_min (sched_policy);
- int max_priority = ACE_Sched_Params::priority_max (sched_policy);
+ properties->orb (orb);
+ properties->default_poa (default_poa.in ());
- if (TAO_debug_level > 0)
- {
- ACE_DEBUG ((LM_DEBUG, "max_priority = %d, min_priority = %d\n",
- max_priority, min_priority));
+ // Init the factory
+ this->init_factory (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
- if (max_priority == min_priority)
- {
- ACE_DEBUG ((LM_DEBUG,"Detected max_priority == min_priority\n"));
- }
- }
-
- // Set the main thread to min priority...
- int priority = min_priority;
-
- if (ACE_OS::sched_params (ACE_Sched_Params (sched_policy ,
- priority,
- ACE_SCOPE_PROCESS)) != 0)
- {
- if (ACE_OS::last_error () == EPERM)
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t): user is not superuser, "
- "test runs in time-shared class\n"));
- }
- else
- ACE_ERROR ((LM_ERROR,
- "(%P|%t): sched_params failed\n"));
- }
+ this->init_builder (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
}
void
diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
index afbd64a3bf9..6a00ade8b66 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h
@@ -64,9 +64,6 @@ protected:
/// Create the Builder for Notify objects.
virtual void init_builder (ACE_ENV_SINGLE_ARG_DECL);
- /// Apply ORB Scheduling policy to main thread and set its priority to the lowest available.
- void init_main_thread (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL);
-
/// Set thread options on <qos>.
void set_threads (CosNotification::QoSProperties &qos, int threads);
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
index dd4a581afd9..f8faf3ac96d 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp
@@ -13,8 +13,6 @@ ACE_RCSID (Notify, TAO_NS_Properties, "$Id$")
TAO_NS_Properties::TAO_NS_Properties (void)
: factory_ (0)
, builder_ (0)
- , thr_sched_policy_ (THR_SCHED_DEFAULT)
- , thr_scope_policy_ (THR_SCOPE_PROCESS)
, asynch_updates_ (0)
{
// In case no conf. file is specified, the EC will default to reactive concurrency.
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.h b/TAO/orbsvcs/orbsvcs/Notify/Properties.h
index 4a0a6a03ffc..5eb3d1a6e2e 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Properties.h
+++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.h
@@ -57,12 +57,6 @@ public:
PortableServer::POA_ptr default_poa (void);
void default_poa (PortableServer::POA_ptr default_poa);
- long scope_policy (void);
- void scope_policy (long scope_policy);
-
- long sched_policy (void);
- void sched_policy (long sched_policy);
-
CORBA::Boolean asynch_updates (void);
void asynch_updates (CORBA::Boolean asynch_updates);
@@ -109,12 +103,6 @@ protected:
// POA
PortableServer::POA_var default_poa_;
- /// Sched policy
- long thr_sched_policy_;
-
- /// Scope policy
- long thr_scope_policy_;
-
/// True if send asynch updates.
CORBA::Boolean asynch_updates_;
diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp
index b914c72df2d..2bbd7dd80cf 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp
@@ -51,9 +51,11 @@ TAO_NS_ThreadPool_Task::init (const NotifyExt::ThreadPoolParams& tp_params, TAO_
long flags = THR_NEW_LWP | THR_JOINABLE;
+ CORBA::ORB_var orb =
+ TAO_NS_PROPERTIES::instance()->orb ();
+
flags |=
- TAO_NS_PROPERTIES::instance()->scope_policy () |
- TAO_NS_PROPERTIES::instance()->sched_policy ();
+ orb->orb_core ()->orb_params ()->thread_creation_flags ();
// Increment the count on this object by the number of threads using it.
{