summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-28 20:32:05 +0000
committerthrall <thrall@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-28 20:32:05 +0000
commit727491b62b36e69dd5bec46d2454fb772a2dfee7 (patch)
tree0dc91cef220ace35adac3425597fe5a96b3a0f70
parent3fa808391906b396f49946fa1fa788429b0f3a2e (diff)
downloadATCD-727491b62b36e69dd5bec46d2454fb772a2dfee7.tar.gz
thrall: Added get_config_infos to RtecScheduler::Scheduler interface and implemented it in Runtime, Config, and Reconfig schedulers. Runtime_Scheduler and Config_Scheduler have no-op implementations.
-rw-r--r--TAO/orbsvcs/orbsvcs/RtecScheduler.idl7
-rw-r--r--TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp17
-rw-r--r--TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h8
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h1
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp43
-rw-r--r--TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h7
8 files changed, 99 insertions, 1 deletions
diff --git a/TAO/orbsvcs/orbsvcs/RtecScheduler.idl b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl
index 37248a06a1c..4b47e58aefc 100644
--- a/TAO/orbsvcs/orbsvcs/RtecScheduler.idl
+++ b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl
@@ -367,6 +367,13 @@ module RtecScheduler
//
// If the schedule has not been computed:
// raises (NOT_SCHEDULED);
+
+ void get_config_infos(out Config_Info_Set configs)
+ raises (SYNCHRONIZATION_FAILURE, NOT_SCHEDULED);
+ // Provides the set of Config_Infos associated with the current schedule.
+ //
+ // If the schedule has not been computed:
+ // raises (NOT_SCHEDULED);
};
};
diff --git a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp
index 181011de6f0..f1cf3ca6cd0 100644
--- a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp
+++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp
@@ -295,3 +295,20 @@ ACE_Runtime_Scheduler::last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL)
else
return (RtecScheduler::Preemption_Priority_t) (config_count_ - 1);
}
+
+
+void
+ACE_Runtime_Scheduler::get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ // throw an exception if a valid schedule has not been loaded
+ if (config_count_ <= 0)
+ ACE_THROW_RETURN (RtecScheduler::NOT_SCHEDULED(),
+ (RtecScheduler::Preemption_Priority_t) -1);
+ //TODO: fill the Config_Info_Set with the runtime Config_Infos
+ //for now, this function is unimplemented
+ return;
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h
index 1b85939bc90..10efea4441c 100644
--- a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h
+++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h
@@ -137,6 +137,11 @@ public:
// of scheduled priorities. All scheduled priorities range from 0
// to the number returned, inclusive.
+ virtual void get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::NOT_SCHEDULED));
+
private:
int config_count_;
// The number of elements in the config array.
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp
index 9b2933bf66b..0eaa15d9e0e 100644
--- a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp
+++ b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp
@@ -480,3 +480,15 @@ ACE_Config_Scheduler::last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
// Returns the last priority number assigned to an operation in the schedule.
// The number returned is one less than the total number of scheduled priorities.
// All scheduled priorities range from 0 to the number returned, inclusive.
+
+void
+ACE_Config_Scheduler::get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ //TODO: fill the Config_Info_Set with the runtime Config_Infos
+ //for now, this function is unimplemented
+ return;
+}
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h
index 7288bb466dc..5df134067d1 100644
--- a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h
+++ b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.h
@@ -118,6 +118,14 @@ public:
// All scheduled priorities range from 0 to the number returned,
// inclusive.
+ virtual void get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED));
+ // Provides the set of Config_Infos associated with the current schedule.
+
+
private:
#if defined (TAO_USES_STRATEGY_SCHEDULER)
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h
index 5b6fe21cb88..88704771c7c 100644
--- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Sched_Utils.h
@@ -323,7 +323,6 @@ public:
// on the operation characteristics of a representative scheduling entry.
};
-
#if defined (__ACE_INLINE__)
#include "Reconfig_Sched_Utils.i"
#endif /* __ACE_INLINE__ */
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp
index 091a0715285..f174718e743 100644
--- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp
@@ -793,6 +793,49 @@ last_scheduled_priority (ACE_ENV_SINGLE_ARG_DECL)
return last_scheduled_priority_;
}
+// Provides the set of Config_Infos associated with the current schedule.
+
+template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
+void
+TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::
+get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED))
+{
+ ACE_GUARD_THROW_EX (ACE_LOCK, ace_mon, this->mutex_,
+ RtecScheduler::SYNCHRONIZATION_FAILURE ());
+ ACE_CHECK_RETURN (0);
+
+ // Check schedule stability flags.
+ if ((this->stability_flags_ & SCHED_PRIORITY_NOT_STABLE)
+ && this->enforce_schedule_stability_)
+ {
+ ACE_THROW_RETURN (RtecScheduler::NOT_SCHEDULED (),
+ (RtecScheduler::Preemption_Priority_t) -1);
+ }
+
+ // return the set of Config_Infos
+ if (configs.ptr () == 0)
+ {
+ ACE_NEW_THROW_EX (configs,
+ RtecScheduler::Config_Info_Set(this->
+ config_info_count_),
+ CORBA::NO_MEMORY ());
+ ACE_CHECK;
+ }
+ configs->length (this->config_info_count_);
+ RtecScheduler::Config_Info* config_info = 0;
+ for (ACE_TYPENAME CONFIG_INFO_MAP::iterator config_iter (this->config_info_map_);
+ config_iter.done () == 0;
+ ++config_iter)
+ {
+ config_info = (*config_iter).int_id_;
+ configs[ACE_static_cast (CORBA::ULong, config_info->preemption_priority)] = *config_info;
+ }
+}
+
// Internal method to create an RT_Info. If it does not exist, a new RT_Info is
// created and inserted into the schedule, and the handle of the new
// RT_Info is returned. If the RT_Info already exists, an exception
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h
index d067452daf6..d2b97c245d9 100644
--- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h
+++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h
@@ -222,6 +222,13 @@ public:
// of scheduled priorities. All scheduled priorities range from 0
// to the number returned, inclusive.
+ virtual void get_config_infos (RtecScheduler::Config_Info_Set_out configs
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ RtecScheduler::SYNCHRONIZATION_FAILURE,
+ RtecScheduler::NOT_SCHEDULED));
+ // Provides the set of Config_Infos associated with the current schedule.
+
// = Accessors that allow controlled relaxations of encapsulation.
RECONFIG_SCHED_STRATEGY & sched_strategy ();