summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-23 08:51:14 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-08-23 08:51:14 +0000
commitda2c85fecb85698e813dceb2b4756c0d39a5cf73 (patch)
treefba846236c276cb8a40ea6d457ca385a548af9b1
parent4374c55a784e43e690577dfa3e06c3c3c0a95c9a (diff)
downloadATCD-da2c85fecb85698e813dceb2b4756c0d39a5cf73.tar.gz
Improved support for setting the scheduling policy/scope for RT threads.
Also, removed the priority normalizer.
-rw-r--r--TAO/tao/Default_Protocols_Hooks.cpp2
-rw-r--r--TAO/tao/ORB_Core.cpp35
-rw-r--r--TAO/tao/ORB_Core.h29
-rw-r--r--TAO/tao/RTCORBA/Direct_Priority_Mapping.cpp55
-rw-r--r--TAO/tao/RTCORBA/Direct_Priority_Mapping.h4
-rw-r--r--TAO/tao/RTCORBA/Linear_Priority_Mapping.cpp55
-rw-r--r--TAO/tao/RTCORBA/Linear_Priority_Mapping.h4
-rw-r--r--TAO/tao/RTCORBA/RT_ORB.cpp75
-rw-r--r--TAO/tao/RTCORBA/RT_ORBInitializer.cpp20
-rw-r--r--TAO/tao/RTCORBA/RT_ORBInitializer.h14
-rw-r--r--TAO/tao/RTCORBA/RT_ORB_Loader.cpp32
-rw-r--r--TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp2
-rw-r--r--TAO/tao/RTCORBA/Thread_Pool.cpp12
-rw-r--r--TAO/tao/RTPortableServer/RT_Policy_Validator.cpp6
-rw-r--r--TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp41
-rw-r--r--TAO/tao/Thread_Lane_Resources_Manager.cpp1
-rw-r--r--TAO/tao/params.cpp4
-rw-r--r--TAO/tao/params.h14
-rw-r--r--TAO/tao/params.i24
19 files changed, 130 insertions, 299 deletions
diff --git a/TAO/tao/Default_Protocols_Hooks.cpp b/TAO/tao/Default_Protocols_Hooks.cpp
index 67fabb71ff2..6e356be1282 100644
--- a/TAO/tao/Default_Protocols_Hooks.cpp
+++ b/TAO/tao/Default_Protocols_Hooks.cpp
@@ -109,7 +109,7 @@ TAO_Default_Protocols_Hooks::set_default_policies (CORBA::Environment &)
int
TAO_Default_Protocols_Hooks::set_default_server_protocol_policy (TAO_Acceptor_Registry &,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &)
{
return 0;
}
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 4c2d0103579..26d045a06c1 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -161,8 +161,7 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
parser_registry_ (),
bidir_adapter_ (0),
bidir_giop_policy_ (0),
- flushing_strategy_ (0),
- corba_priority_normalizer_ (0)
+ flushing_strategy_ (0)
{
#if defined(ACE_MVS)
ACE_NEW (this->from_iso8859_, ACE_IBM1047_ISO8859);
@@ -194,9 +193,6 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
ACE_NEW (this->transport_sync_strategy_,
TAO_Transport_Sync_Strategy);
-
- ACE_NEW (this->corba_priority_normalizer_,
- TAO_CORBA_Priority_Normalizer);
}
TAO_ORB_Core::~TAO_ORB_Core (void)
@@ -226,8 +222,6 @@ TAO_ORB_Core::~TAO_ORB_Core (void)
#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
delete this->transport_sync_strategy_;
-
- delete this->corba_priority_normalizer_;
}
#if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
@@ -1136,31 +1130,6 @@ TAO_ORB_Core::fini (void)
return 0;
}
-TAO_CORBA_Priority_Normalizer::~TAO_CORBA_Priority_Normalizer (void)
-{
-}
-
-CORBA::Boolean
-TAO_CORBA_Priority_Normalizer::normalize (CORBA::Short corba_priority,
- CORBA::Short &normalized_corba_priority)
-{
- normalized_corba_priority = corba_priority;
- return 1;
-}
-
-TAO_CORBA_Priority_Normalizer *
-TAO_ORB_Core::corba_priority_normalizer (void) const
-{
- return this->corba_priority_normalizer_;
-}
-
-void
-TAO_ORB_Core::corba_priority_normalizer (TAO_CORBA_Priority_Normalizer *new_normalizer)
-{
- delete this->corba_priority_normalizer_;
- this->corba_priority_normalizer_ = new_normalizer;
-}
-
void
TAO_ORB_Core::set_thread_lane_resources_manager_factory (const char *thread_lane_resources_manager_factory_name)
{
@@ -1757,7 +1726,7 @@ TAO_ORB_Core::lf_strategy (void)
int
TAO_ORB_Core::run (ACE_Time_Value *tv,
int perform_work,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &)
{
if (TAO_debug_level >= 3)
ACE_DEBUG ((LM_DEBUG,
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 1cde2721d19..8dadda6776c 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -161,25 +161,6 @@ public:
// ****************************************************************
/**
- * @class TAO_CORBA_Priority_Normalizer
- *
- * @brief Used to keep Strategy library separate from the RT library.
- **/
-class TAO_Export TAO_CORBA_Priority_Normalizer
-{
-public:
-
- /// Virtual destructor
- virtual ~TAO_CORBA_Priority_Normalizer (void);
-
- /// Normalize CORBA Priority
- virtual CORBA::Boolean normalize (CORBA::Short corba_priority,
- CORBA::Short &normalized_corba_priority);
-};
-
-// ****************************************************************
-
-/**
* @class TAO_ORB_Core
*
* @brief Encapsulates the state of an ORB.
@@ -256,13 +237,6 @@ public:
/// Get the adapter registry
TAO_Adapter_Registry *adapter_registry (void);
- /// Get the priority normalizer.
- TAO_CORBA_Priority_Normalizer *corba_priority_normalizer (void) const;
-
- /// Set the priority normalizer. Takes over the memory management
- //of <new_normalizer>: <new_normalizer> will be deleted.
- void corba_priority_normalizer (TAO_CORBA_Priority_Normalizer *new_normalizer);
-
/// @name Collocation Strategies
//@{
enum
@@ -1209,9 +1183,6 @@ protected:
/// Hold the flushing strategy
TAO_Flushing_Strategy *flushing_strategy_;
-
- /// CORBA Priority Normalizer.
- TAO_CORBA_Priority_Normalizer *corba_priority_normalizer_;
};
// ****************************************************************
diff --git a/TAO/tao/RTCORBA/Direct_Priority_Mapping.cpp b/TAO/tao/RTCORBA/Direct_Priority_Mapping.cpp
index 4018aecbf04..2aa132a855f 100644
--- a/TAO/tao/RTCORBA/Direct_Priority_Mapping.cpp
+++ b/TAO/tao/RTCORBA/Direct_Priority_Mapping.cpp
@@ -11,62 +11,11 @@
ACE_RCSID(Strategies, Direct_Priority_Mapping, "$Id$")
-TAO_Direct_Priority_Mapping::TAO_Direct_Priority_Mapping (int policy)
- : policy_ (policy)
+TAO_Direct_Priority_Mapping::TAO_Direct_Priority_Mapping (long policy)
+ : policy_ (policy)
{
- // We have special behavior for SUNs. This is because the results
- // from ACE_Sched_Params::priority_min() and
- // ACE_Sched_Params::priority_max() are not correct.
-
-#if defined (sun)
-
- ACE_utsname name;
- ACE_OS::uname (&name);
-
- // If we are on Solaris 5.7.
- if (ACE_OS::strcmp (name.release, "5.7") == 0)
- {
- if (policy == ACE_SCHED_OTHER)
- {
- this->min_ = 0;
- this->max_ = 127;
- }
- else
- {
- this->min_ = 0;
- this->max_ = 59;
- }
- }
- // If we are on Solaris 5.8.
- else if (ACE_OS::strcmp (name.release, "5.8") == 0)
- {
- if (policy == ACE_SCHED_OTHER)
- {
- this->min_ = -20;
- this->max_ = 127;
- }
- else
- {
- this->min_ = 0;
- this->max_ = 59;
- }
- }
- // Not sure about the other SUN releases. Therefore, lets stick to
- // the default behavior.
- else
- {
- this->min_ = ACE_Sched_Params::priority_min (this->policy_);
- this->max_ = ACE_Sched_Params::priority_max (this->policy_);
- }
-
-#else /* sun */
-
- // Other platforms should be ok.
this->min_ = ACE_Sched_Params::priority_min (this->policy_);
this->max_ = ACE_Sched_Params::priority_max (this->policy_);
-
-#endif /* sun */
-
}
TAO_Direct_Priority_Mapping::~TAO_Direct_Priority_Mapping (void)
diff --git a/TAO/tao/RTCORBA/Direct_Priority_Mapping.h b/TAO/tao/RTCORBA/Direct_Priority_Mapping.h
index 91e7d635e02..b5e08e947de 100644
--- a/TAO/tao/RTCORBA/Direct_Priority_Mapping.h
+++ b/TAO/tao/RTCORBA/Direct_Priority_Mapping.h
@@ -43,7 +43,7 @@ class TAO_RTCORBA_Export TAO_Direct_Priority_Mapping : public TAO_Priority_Mappi
// priorities (0...32767)
//
public:
- TAO_Direct_Priority_Mapping (int policy = ACE_SCHED_OTHER);
+ TAO_Direct_Priority_Mapping (long policy);
// Default constructor
virtual ~TAO_Direct_Priority_Mapping (void);
@@ -57,7 +57,7 @@ public:
RTCORBA::Priority &corba_priority);
private:
- int policy_;
+ long policy_;
// The scheduling policy
int min_;
diff --git a/TAO/tao/RTCORBA/Linear_Priority_Mapping.cpp b/TAO/tao/RTCORBA/Linear_Priority_Mapping.cpp
index e6fe6ff9eb6..c81ac2c67ae 100644
--- a/TAO/tao/RTCORBA/Linear_Priority_Mapping.cpp
+++ b/TAO/tao/RTCORBA/Linear_Priority_Mapping.cpp
@@ -12,62 +12,11 @@
ACE_RCSID(Strategies, Linear_Priority_Mapping, "$Id$")
-TAO_Linear_Priority_Mapping::TAO_Linear_Priority_Mapping (int policy)
- : policy_ (policy)
+TAO_Linear_Priority_Mapping::TAO_Linear_Priority_Mapping (long policy)
+ : policy_ (policy)
{
- // We have special behavior for SUNs. This is because the results
- // from ACE_Sched_Params::priority_min() and
- // ACE_Sched_Params::priority_max() are not correct.
-
-#if defined (sun)
-
- ACE_utsname name;
- ACE_OS::uname (&name);
-
- // If we are on Solaris 5.7.
- if (ACE_OS::strcmp (name.release, "5.7") == 0)
- {
- if (policy == ACE_SCHED_OTHER)
- {
- this->min_ = 0;
- this->max_ = 127;
- }
- else
- {
- this->min_ = 0;
- this->max_ = 59;
- }
- }
- // If we are on Solaris 5.8.
- else if (ACE_OS::strcmp (name.release, "5.8") == 0)
- {
- if (policy == ACE_SCHED_OTHER)
- {
- this->min_ = -20;
- this->max_ = 127;
- }
- else
- {
- this->min_ = 0;
- this->max_ = 59;
- }
- }
- // Not sure about the other SUN releases. Therefore, lets stick to
- // the default behavior.
- else
- {
- this->min_ = ACE_Sched_Params::priority_min (this->policy_);
- this->max_ = ACE_Sched_Params::priority_max (this->policy_);
- }
-
-#else /* sun */
-
- // Other platforms should be ok.
this->min_ = ACE_Sched_Params::priority_min (this->policy_);
this->max_ = ACE_Sched_Params::priority_max (this->policy_);
-
-#endif /* sun */
-
}
TAO_Linear_Priority_Mapping::~TAO_Linear_Priority_Mapping (void)
diff --git a/TAO/tao/RTCORBA/Linear_Priority_Mapping.h b/TAO/tao/RTCORBA/Linear_Priority_Mapping.h
index 9428f7af1fe..059c2534560 100644
--- a/TAO/tao/RTCORBA/Linear_Priority_Mapping.h
+++ b/TAO/tao/RTCORBA/Linear_Priority_Mapping.h
@@ -43,7 +43,7 @@ class TAO_RTCORBA_Export TAO_Linear_Priority_Mapping : public TAO_Priority_Mappi
// priorities (0...32767)
//
public:
- TAO_Linear_Priority_Mapping (int policy = ACE_SCHED_OTHER);
+ TAO_Linear_Priority_Mapping (long policy);
// Default constructor
virtual ~TAO_Linear_Priority_Mapping (void);
@@ -57,7 +57,7 @@ public:
RTCORBA::Priority &corba_priority);
private:
- int policy_;
+ long policy_;
// The scheduling policy
int min_;
diff --git a/TAO/tao/RTCORBA/RT_ORB.cpp b/TAO/tao/RTCORBA/RT_ORB.cpp
index cd20930c6ea..037fa0238ba 100644
--- a/TAO/tao/RTCORBA/RT_ORB.cpp
+++ b/TAO/tao/RTCORBA/RT_ORB.cpp
@@ -14,86 +14,11 @@
ACE_RCSID(TAO, RT_ORB, "$Id$")
-class TAO_RT_CORBA_Priority_Normalizer : public TAO_CORBA_Priority_Normalizer
-{
-public:
- /// Constructor.
- TAO_RT_CORBA_Priority_Normalizer (TAO_ORB_Core *orb_core);
-
- /// Normalize CORBA Priority
- CORBA::Boolean normalize (CORBA::Short corba_priority,
- CORBA::Short &normalized_corba_priority);
-
-private:
- // Reference to the priority mapping.
- RTCORBA::PriorityMapping *priority_mapping_;
-};
-
-TAO_RT_CORBA_Priority_Normalizer::TAO_RT_CORBA_Priority_Normalizer (TAO_ORB_Core *orb_core)
-{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
- {
- // Save a reference to the priority mapping manager.
- CORBA::Object_var obj =
- orb_core->object_ref_table ().resolve_initial_references (
- TAO_OBJID_PRIORITYMAPPINGMANAGER,
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- TAO_Priority_Mapping_Manager_var mapping_manager =
- TAO_Priority_Mapping_Manager::_narrow (obj.in (),
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- if (CORBA::is_nil (mapping_manager.in ()))
- ACE_TRY_THROW (CORBA::INTERNAL ());
-
- this->priority_mapping_ =
- mapping_manager->mapping ();
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "(%P|%t) ERROR: Problem in CORBA Priority "
- "Normalizer constructor.\n");
-
- return;
- }
- ACE_ENDTRY;
-}
-
-CORBA::Boolean
-TAO_RT_CORBA_Priority_Normalizer::normalize (CORBA::Short corba_priority,
- CORBA::Short &normalized_corba_priority)
-{
- CORBA::Short native_priority;
-
- CORBA::Boolean result =
- this->priority_mapping_->to_native (corba_priority,
- native_priority);
- if (result == 0)
- return 0;
-
- result =
- this->priority_mapping_->to_CORBA (native_priority,
- normalized_corba_priority);
- if (result == 0)
- return 0;
-
- return 1;
-}
-
TAO_RT_ORB::TAO_RT_ORB (TAO_ORB_Core *orb_core)
: orb_core_ (orb_core),
mutex_mgr_ (),
tp_manager_ (0)
{
- TAO_RT_CORBA_Priority_Normalizer *corba_priority_normalizer = 0;
- ACE_NEW (corba_priority_normalizer,
- TAO_RT_CORBA_Priority_Normalizer (orb_core));
- orb_core->corba_priority_normalizer (corba_priority_normalizer);
-
TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager =
&this->orb_core_->thread_lane_resources_manager ();
diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
index 838f8d8d856..4c2e01ea6ca 100644
--- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
+++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
@@ -32,9 +32,11 @@ static const char *rt_poa_factory_name = "TAO_RT_POA";
static const char *rt_poa_factory_directive = "dynamic TAO_RT_POA Service_Object * TAO_RTPortableServer:_make_TAO_RT_Object_Adapter_Factory()";
TAO_RT_ORBInitializer::TAO_RT_ORBInitializer (int priority_mapping_type,
- int sched_policy)
+ long sched_policy,
+ long scope_policy)
: priority_mapping_type_ (priority_mapping_type),
- sched_policy_ (sched_policy)
+ sched_policy_ (sched_policy),
+ scope_policy_ (scope_policy)
{
}
@@ -78,18 +80,25 @@ TAO_RT_ORBInitializer::pre_init (
TAO_RT_Protocols_Hooks::set_server_protocols_hook
(TAO_ServerProtocolPolicy::hook);
+ // Conversion.
+ long sched_policy = SCHED_OTHER;
+ if (this->sched_policy_ == THR_SCHED_FIFO)
+ sched_policy = SCHED_FIFO;
+ else if (this->sched_policy_ == THR_SCHED_RR)
+ sched_policy = SCHED_RR;
+
// Create the initial priority mapping instance.
TAO_Priority_Mapping *pm;
switch (this->priority_mapping_type_)
{
case TAO_PRIORITY_MAPPING_LINEAR:
ACE_NEW (pm,
- TAO_Linear_Priority_Mapping (this->sched_policy_));
+ TAO_Linear_Priority_Mapping (sched_policy));
break;
default:
case TAO_PRIORITY_MAPPING_DIRECT:
ACE_NEW (pm,
- TAO_Direct_Priority_Mapping (this->sched_policy_));
+ TAO_Direct_Priority_Mapping (sched_policy));
break;
}
@@ -165,6 +174,9 @@ TAO_RT_ORBInitializer::pre_init (
current,
ACE_TRY_ENV);
ACE_CHECK;
+
+ tao_info->orb_core ()->orb_params ()->scope_policy (this->scope_policy_);
+ tao_info->orb_core ()->orb_params ()->sched_policy (this->sched_policy_);
}
void
diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.h b/TAO/tao/RTCORBA/RT_ORBInitializer.h
index 88ec7c6fdf1..d90a160eaab 100644
--- a/TAO/tao/RTCORBA/RT_ORBInitializer.h
+++ b/TAO/tao/RTCORBA/RT_ORBInitializer.h
@@ -43,14 +43,15 @@ class TAO_RTCORBA_Export TAO_RT_ORBInitializer :
{
public:
// Priority mapping types
- enum
+ enum
{
TAO_PRIORITY_MAPPING_LINEAR,
TAO_PRIORITY_MAPPING_DIRECT
};
TAO_RT_ORBInitializer (int priority_mapping_type,
- int sched_policy);
+ long sched_policy,
+ long scope_policy);
virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
TAO_ENV_ARG_DECL_WITH_DEFAULTS)
@@ -74,11 +75,14 @@ private:
/// a single instance between all ORBs.
TAO_RT_PolicyFactory policy_factory_;
- /// Initial priority mapping type.
+ /// Priority mapping type.
int priority_mapping_type_;
- /// Initial scheduling policy.
- int sched_policy_;
+ /// Scheduling policy.
+ long sched_policy_;
+
+ /// Scope policy.
+ long scope_policy_;
};
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
index 1497aac01e0..16e9bfc76f7 100644
--- a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
+++ b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
@@ -33,7 +33,8 @@ TAO_RT_ORB_Loader::init (int argc,
// Set defaults.
int priority_mapping_type = TAO_RT_ORBInitializer::TAO_PRIORITY_MAPPING_DIRECT;
- int sched_policy = ACE_SCHED_OTHER;
+ long sched_policy = THR_SCHED_DEFAULT;
+ long scope_policy = THR_SCOPE_PROCESS;
int curarg = 0;
// Parse any service configurator parameters.
@@ -68,19 +69,39 @@ TAO_RT_ORB_Loader::init (int argc,
if (ACE_OS::strcasecmp (name,
"SCHED_OTHER") == 0)
- sched_policy = ACE_SCHED_OTHER;
+ sched_policy = THR_SCHED_DEFAULT;
else if (ACE_OS::strcasecmp (name,
"SCHED_FIFO") == 0)
- sched_policy = ACE_SCHED_FIFO;
+ sched_policy = THR_SCHED_FIFO;
else if (ACE_OS::strcasecmp (name,
"SCHED_RR") == 0)
- sched_policy = ACE_SCHED_RR;
+ sched_policy = THR_SCHED_RR;
else
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("RT_ORB_Loader - unknown argument")
ACE_TEXT (" <%s> for -ORBSchedPolicy\n"), name));
}
}
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ "-ORBScopePolicy") == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ char *name = argv[curarg];
+
+ if (ACE_OS::strcasecmp (name,
+ "SYSTEM") == 0)
+ scope_policy = THR_SCOPE_SYSTEM;
+ else if (ACE_OS::strcasecmp (name,
+ "PROCESS") == 0)
+ scope_policy = THR_SCOPE_PROCESS;
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("RT_ORB_Loader - unknown argument")
+ ACE_TEXT (" <%s> for -ORBScopePolicy\n"), name));
+ }
+ }
else
{
if (TAO_debug_level > 0)
@@ -102,7 +123,8 @@ TAO_RT_ORB_Loader::init (int argc,
/// Register the RTCORBA ORBInitializer.
ACE_NEW_THROW_EX (temp_orb_initializer,
TAO_RT_ORBInitializer (priority_mapping_type,
- sched_policy),
+ sched_policy,
+ scope_policy),
CORBA::NO_MEMORY (
CORBA_SystemException::_tao_minor_code (
TAO_DEFAULT_MINOR_CODE,
diff --git a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp
index 0a76147ba5b..c0368f6257a 100644
--- a/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp
+++ b/TAO/tao/RTCORBA/RT_Thread_Lane_Resources_Manager.cpp
@@ -131,7 +131,7 @@ TAO_RT_Thread_Lane_Resources_Manager::default_lane_resources (void)
int
TAO_RT_Thread_Lane_Resources_Manager::shutdown_reactors (TAO_Thread_Lane_Resources &lane_resources,
- CORBA_Environment &ACE_TRY_ENV)
+ CORBA_Environment &)
{
TAO_Leader_Follower &leader_follower =
lane_resources.leader_follower ();
diff --git a/TAO/tao/RTCORBA/Thread_Pool.cpp b/TAO/tao/RTCORBA/Thread_Pool.cpp
index 63457cb30b6..021f4b9fa8f 100644
--- a/TAO/tao/RTCORBA/Thread_Pool.cpp
+++ b/TAO/tao/RTCORBA/Thread_Pool.cpp
@@ -75,7 +75,7 @@ TAO_Thread_Lane::TAO_Thread_Lane (TAO_Thread_Pool &pool,
CORBA::Short lane_priority,
CORBA::ULong static_threads,
CORBA::ULong dynamic_threads,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Environment &)
: pool_ (pool),
id_ (id),
lane_priority_ (lane_priority),
@@ -196,8 +196,16 @@ TAO_Thread_Lane::create_dynamic_threads (CORBA::ULong number_of_threads)
// deleted.
ACE_Auto_Basic_Array_Ptr<size_t> auto_stack_size_array (stack_size_array);
+ TAO_ORB_Core &orb_core =
+ this->pool ().manager ().orb_core ();
+
+ long flags =
+ default_flags |
+ orb_core.orb_params ()->scope_policy () |
+ orb_core.orb_params ()->sched_policy ();
+
// Activate the threads.
- return this->threads_.activate (default_flags,
+ return this->threads_.activate (flags,
number_of_threads,
force_active,
this->native_priority_,
diff --git a/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp b/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp
index 5ee6730cb04..1d0edd7b526 100644
--- a/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp
+++ b/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp
@@ -197,7 +197,7 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies,
}
// Check 3.
- if (rt_priority_model == RTCORBA::SERVER_DECLARED)
+ if (rt_priority_model == TAO_POA_Cached_Policies::SERVER_DECLARED)
{
int match = 0;
for (CORBA::ULong i = 0; i < bands.length (); ++i)
@@ -259,7 +259,7 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies,
// model is SERVER_DECLARED, make sure we have at least one thread
// lane that can provide service for the specified SERVER_DECLARED
// priority.
- if (rt_priority_model == RTCORBA::SERVER_DECLARED)
+ if (rt_priority_model == TAO_POA_Cached_Policies::SERVER_DECLARED)
{
// If this POA is using the default thread pool (which doesn't
// have lanes) or a thread pool without lanes, we are done with
@@ -392,7 +392,7 @@ TAO_POA_RT_Policy_Validator::extract_thread_pool (TAO_ORB_Core &orb_core,
ACE_CHECK_RETURN (0);
RTCORBA::RTORB_var rt_orb =
- RTCORBA::RTORB::_narrow (object,
+ RTCORBA::RTORB::_narrow (object.in (),
ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp
index df8b6609ffb..2de402a54be 100644
--- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp
+++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp
@@ -72,9 +72,10 @@ RT_Priority_Model_Processing::pre_invoke (
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Using thread pool with lane ")
- ACE_TEXT ("(%P|%t|%d|%d): original thread priority not changed\n"),
+ ACE_TEXT ("(%P|%t|%d|%d): original thread CORBA priority %d not changed\n"),
lane->pool ().id (),
- lane->id ()));
+ lane->id (),
+ lane->lane_priority ()));
}
return;
@@ -173,37 +174,17 @@ RT_Priority_Model_Processing::pre_invoke (
ACE_TEXT ("temporarily changed to CORBA %d\n"),
priority_model,
thread_pool_id,
- original_CORBA_priority_,
- original_native_priority_,
+ this->original_CORBA_priority_,
+ this->original_native_priority_,
target_priority));
}
- // Change the priority of the current thread to the target value
- // for the duration of request.
- if (this->original_CORBA_priority_ != target_priority)
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("RTCORBA::CLIENT_PROPAGATED processing")
- ACE_TEXT (" (%P|%t): original thread CORBA/native priority %d/%d;")
- ACE_TEXT (" temporarily changed to CORBA priority %d\n"),
- this->original_CORBA_priority_,
- this->original_native_priority_,
- target_priority));
-
- if (tph->set_thread_CORBA_priority (target_priority,
- ACE_TRY_ENV)
- == -1)
- ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO));
-
- this->state_ = PRIORITY_RESET_REQUIRED;
- }
- else if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("RTCORBA::CLIENT_PROPAGATED processing")
- ACE_TEXT (" (%P|%t): original thread priority =")
- ACE_TEXT (" requested priority = %d\n"),
- target_priority));
+ if (tph->set_thread_CORBA_priority (target_priority,
+ ACE_TRY_ENV)
+ == -1)
+ ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO));
+
+ this->state_ = PRIORITY_RESET_REQUIRED;
}
else if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
diff --git a/TAO/tao/Thread_Lane_Resources_Manager.cpp b/TAO/tao/Thread_Lane_Resources_Manager.cpp
index 744cf888d42..2aebbcfb090 100644
--- a/TAO/tao/Thread_Lane_Resources_Manager.cpp
+++ b/TAO/tao/Thread_Lane_Resources_Manager.cpp
@@ -3,6 +3,7 @@
#include "tao/Thread_Lane_Resources_Manager.h"
#include "tao/Leader_Follower.h"
#include "tao/LF_Strategy.h"
+#include "ace/Dynamic_Service.h"
ACE_RCSID(tao, Thread_Lane_Resources_Manager, "$Id$")
diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp
index a5491da6cec..a559eee4581 100644
--- a/TAO/tao/params.cpp
+++ b/TAO/tao/params.cpp
@@ -22,7 +22,9 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void)
cdr_memcpy_tradeoff_ (ACE_DEFAULT_CDR_MEMCPY_TRADEOFF),
use_lite_protocol_ (0),
use_dotted_decimal_addresses_ (0),
- std_profile_components_ (1)
+ std_profile_components_ (1),
+ sched_policy_ (THR_SCHED_DEFAULT),
+ scope_policy_ (THR_SCOPE_PROCESS)
{
for (int i=0; i<= NO_OF_MCAST_SERVICES; i++)
this->service_port_[i] = 0;
diff --git a/TAO/tao/params.h b/TAO/tao/params.h
index 09a976de7ae..661bc64b482 100644
--- a/TAO/tao/params.h
+++ b/TAO/tao/params.h
@@ -133,6 +133,14 @@ public:
int std_profile_components (void) const;
void std_profile_components (int x);
+ /// Thread scheduling policy.
+ long sched_policy (void) const;
+ void sched_policy (long x);
+
+ /// Thread scope policy.
+ long scope_policy (void) const;
+ void scope_policy (long x);
+
private:
// Each "endpoint" is of the form:
//
@@ -192,6 +200,12 @@ private:
/// If true then the standard OMG components are not generated.
int std_profile_components_;
+
+ /// Thread scheduling policy.
+ long sched_policy_;
+
+ /// Thread scope policy.
+ long scope_policy_;
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/params.i b/TAO/tao/params.i
index 450d9b93b47..86efd40b62c 100644
--- a/TAO/tao/params.i
+++ b/TAO/tao/params.i
@@ -165,3 +165,27 @@ TAO_ORB_Parameters::nodelay (int x)
{
this->nodelay_ = x;
}
+
+ACE_INLINE long
+TAO_ORB_Parameters::sched_policy (void) const
+{
+ return this->sched_policy_;
+}
+
+ACE_INLINE void
+TAO_ORB_Parameters::sched_policy (long x)
+{
+ this->sched_policy_ = x;
+}
+
+ACE_INLINE long
+TAO_ORB_Parameters::scope_policy (void) const
+{
+ return this->scope_policy_;
+}
+
+ACE_INLINE void
+TAO_ORB_Parameters::scope_policy (long x)
+{
+ this->scope_policy_ = x;
+}