📄 reconfig_scheduler_t.h
字号:
/* -*- C++ -*- */
// Reconfig_Scheduler_T.h,v 1.22 2003/08/26 01:26:02 venkita Exp
// ============================================================================
//
// = LIBRARY
// orbsvcs
//
// = FILENAME
// Reconfig_Scheduler_T.h
//
// = AUTHOR
// Chris Gill <cdgill@cs.wustl.edu>
//
// ============================================================================
#ifndef TAO_RECONFIG_SCHEDULER_T_H
#define TAO_RECONFIG_SCHEDULER_T_H
#include /**/ "ace/pre.h"
#include "ace/config-all.h"
#include "Reconfig_Scheduler.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK>
class TAO_Reconfig_Scheduler :
public POA_RtecScheduler::Scheduler
// = TITLE
// A servant for RtecScheduler::Scheduler that can be initialized
// and run solely with precomputed scheduling information, but is also
// designed to perform efficient recomputation of scheduling info
// in the face of run-time changes to RT_Infos in the schedule.
//
// = DESCRIPTION
// This class implements the TAO scheduling service. It has
// the ability to accept and use precomputed scheduling information
// with deterministic performance once the schedule is fully configured.
// It also provides efficient and flexible lookup and computation
// during schedule configuration, so that it can be used during
// both schedule configuration and run-time phases of operation.
//
{
public:
typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
TAO_RT_Info_Ex *,
ACE_Hash<RtecScheduler::handle_t>,
ACE_Equal_To<RtecScheduler::handle_t>,
ACE_LOCK> RT_INFO_MAP;
// Type of map used for O(1) lookup of RT_Infos by their handles.
typedef ACE_RB_Tree<const char *,
TAO_RT_Info_Ex*,
ACE_Less_Than<const char *>,
ACE_LOCK> RT_INFO_TREE;
// Type of tree used for O(log n) lookup of RT_Infos by their names.
typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::Preemption_Priority_t,
RtecScheduler::Config_Info*,
ACE_Hash<RtecScheduler::Preemption_Priority_t>,
ACE_Equal_To<RtecScheduler::Preemption_Priority_t>,
ACE_LOCK> CONFIG_INFO_MAP;
// Type of map used for O(1) lookup of Config_Infos by their priorities.
typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t,
RtecScheduler::Dependency_Set*,
ACE_Hash<RtecScheduler::handle_t>,
ACE_Equal_To<RtecScheduler::handle_t>,
ACE_LOCK> DEPENDENCY_SET_MAP;
// Type of map used for O(1) lookup of RT_Info
// dependency sets by caller or called handle.
typedef typename DEPENDENCY_SET_MAP::ITERATOR DEPENDENCY_SET_MAP_ITERATOR;
// Type of iterator for traversal of RT_Info dependency sets by
// caller or called handle.
TAO_Reconfig_Scheduler (int enforce_schedule_stability = 0,
const CORBA::Double & critical_utilization_threshold = 1.0,
const CORBA::Double & noncritical_utilization_threshold = 1.1);
// Default constructor.
TAO_Reconfig_Scheduler (int config_count,
ACE_Scheduler_Factory::POD_Config_Info config_info[],
int entry_count,
ACE_Scheduler_Factory::POD_RT_Info rt_info[],
int dependency_count,
ACE_Scheduler_Factory::POD_Dependency_Info dependency_info[],
u_long stability_flags,
int enforce_schedule_stability = 0,
const CORBA::Double & critical_utilization_threshold = 1.0,
const CORBA::Double & noncritical_utilization_threshold = 1.1);
// Constructor. Initialize the scheduler from POD_Config_Info, POD_RT_Info,
// and POD_Dependency arrays, plus schedule stability flags.
~TAO_Reconfig_Scheduler ();
// Destructor.
int init (int config_count,
ACE_Scheduler_Factory::POD_Config_Info config_info[],
int rt_info_count,
ACE_Scheduler_Factory::POD_RT_Info rt_info[],
int dependency_count,
ACE_Scheduler_Factory::POD_Dependency_Info dependency_info[],
u_long stability_flags
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::DUPLICATE_NAME,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::SYNCHRONIZATION_FAILURE,
RtecScheduler::INTERNAL));
// Initializes the scheduler with the passed information.
void close (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::INTERNAL,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Closes the scheduler, releasing all current resources.
virtual RtecScheduler::handle_t create (const char * entry_point
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::DUPLICATE_NAME,
RtecScheduler::INTERNAL,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// 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
// is thrown.
virtual RtecScheduler::handle_t lookup (const char * entry_point
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Lookup a handle for an RT_Info, and return its handle, or an error
// value if it's not present.
virtual RtecScheduler::RT_Info* get (RtecScheduler::handle_t handle
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Return a pointer to the RT_Info corresponding to the passed handle.
virtual void set (RtecScheduler::handle_t handle,
RtecScheduler::Criticality_t criticality,
RtecScheduler::Time time,
RtecScheduler::Time typical_time,
RtecScheduler::Time cached_time,
RtecScheduler::Period_t period,
RtecScheduler::Importance_t importance,
RtecScheduler::Quantum_t quantum,
CORBA::Long threads,
RtecScheduler::Info_Type_t info_type
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::INTERNAL,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Set characteristics of the RT_Info corresponding to the passed handle.
virtual void reset (RtecScheduler::handle_t handle,
RtecScheduler::Criticality_t criticality,
RtecScheduler::Time time,
RtecScheduler::Time typical_time,
RtecScheduler::Time cached_time,
RtecScheduler::Period_t period,
RtecScheduler::Importance_t importance,
RtecScheduler::Quantum_t quantum,
CORBA::Long threads,
RtecScheduler::Info_Type_t info_type
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::INTERNAL,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Reset characteristics of the RT_Info corresponding to the passed handle.
virtual void set_seq (const RtecScheduler::RT_Info_Set& infos
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::INTERNAL,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Set characteristics of the RT_Infos corresponding to the passed handles.
// Tuples are added in the case of existing and/or multiple definitions.
virtual void reset_seq (const RtecScheduler::RT_Info_Set& infos
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::INTERNAL,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Reset characteristics of the RT_Infos corresponding to the passed handles.
// Tuples are replaced in the case of existing and/or multiple definitions.
virtual void replace_seq (const RtecScheduler::RT_Info_Set& infos
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::INTERNAL,
RtecScheduler::SYNCHRONIZATION_FAILURE));
// Replace all RT_Infos, resetting characteristics of the RT_Infos
// corresponding to the passed handles. All other RT_Infos are
// reset to their uninitialized values, i.e., the same they have
// just after the create call.
virtual void priority (RtecScheduler::handle_t handle,
RtecScheduler::OS_Priority& o_priority,
RtecScheduler::Preemption_Subpriority_t& p_subpriority,
RtecScheduler::Preemption_Priority_t& p_priority
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::SYNCHRONIZATION_FAILURE,
RtecScheduler::NOT_SCHEDULED));
// Returns the priority and subpriority values assigned to an RT_Info,
// based on its handle.
virtual void entry_point_priority (const char * entry_point,
RtecScheduler::OS_Priority& o_priority,
RtecScheduler::Preemption_Subpriority_t& p_subpriority,
RtecScheduler::Preemption_Priority_t& p_priority
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::UNKNOWN_TASK,
RtecScheduler::SYNCHRONIZATION_FAILURE,
RtecScheduler::NOT_SCHEDULED));
// Returns the priority and subpriority values assigned to an RT_Info,
// based on its entry point name.
virtual void add_dependency (RtecScheduler::handle_t handle,
RtecScheduler::handle_t dependency,
CORBA::Long number_of_calls,
RtecScheduler::Dependency_Type_t dependency_type
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::SYNCHRONIZATION_FAILURE,
RtecScheduler::UNKNOWN_TASK));
// This method registers a dependency between two RT_Infos.
virtual void remove_dependency (RtecScheduler::handle_t handle,
RtecScheduler::handle_t dependency,
CORBA::Long number_of_calls,
RtecScheduler::Dependency_Type_t dependency_type
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
RtecScheduler::SYNCHRONIZATION_FAILURE,
RtecScheduler::UNKNOWN_TASK));
// This method removes a dependency between two RT_Infos.
virtual void set_dependency_enable_state (RtecScheduler::handle_t handle,
RtecScheduler::handle_t dependency,
CORBA::Long number_of_calls,
RtecScheduler::Dependency_Type_t dependency_type,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -