diff options
Diffstat (limited to 'TAO/local/bin/Scheduling_Service')
17 files changed, 0 insertions, 5174 deletions
diff --git a/TAO/local/bin/Scheduling_Service/.cvsignore b/TAO/local/bin/Scheduling_Service/.cvsignore deleted file mode 100644 index ffbc428cd7f..00000000000 --- a/TAO/local/bin/Scheduling_Service/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -schedule_service -dump_schedule - diff --git a/TAO/local/bin/Scheduling_Service/Config_Scheduler.cpp b/TAO/local/bin/Scheduling_Service/Config_Scheduler.cpp deleted file mode 100644 index d9862e1138c..00000000000 --- a/TAO/local/bin/Scheduling_Service/Config_Scheduler.cpp +++ /dev/null @@ -1,255 +0,0 @@ -// ============================================================================ -// -// $Id$ -// -// ============================================================================ - -#include "Scheduler_Internal.h" -#include "Config_Scheduler.h" - -#if defined (__ACE_INLINE__) -#include "Config_Scheduler.i" -#endif /* __ACE_INLINE__ */ - -ACE_Config_Scheduler::ACE_Config_Scheduler (void) - : POA_RtecScheduler::Scheduler ("Scheduler_Internal"), - impl(new Scheduler_Internal) -{ - impl->output_level (10); -} - -ACE_Config_Scheduler::~ACE_Config_Scheduler (void) -{ - delete impl; -} - -RtecScheduler::handle_t -ACE_Config_Scheduler::create (const char * entry_point, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::DUPLICATE_NAME)) -{ - typedef RtecScheduler::RT_Info* RT_Info_ptr; - - RtecScheduler::RT_Info** rt_info; - ACE_NEW_RETURN (rt_info, RT_Info_ptr[1], -1); - - ACE_NEW_RETURN (rt_info[0], RtecScheduler::RT_Info, -1); - - rt_info[0]->entry_point = CORBA::string_dup(entry_point); - rt_info[0]->handle = -1; - rt_info[0]->worst_case_execution_time = 0; - rt_info[0]->typical_execution_time = 0; - rt_info[0]->cached_execution_time = 0; - rt_info[0]->period = 0; - rt_info[0]->importance = RtecScheduler::VERY_LOW; - rt_info[0]->quantum = RtecScheduler::NO_QUANTUM; - rt_info[0]->threads = 0; - rt_info[0]->priority = 0; - rt_info[0]->subpriority = 0; - rt_info[0]->preemption_priority = 0; - - RtecScheduler::handle_t handle = -1; - switch (impl->register_task (rt_info, 1, handle)) - { - case ACE_Scheduler::SUCCEEDED: - break; - case ACE_Scheduler::ST_VIRTUAL_MEMORY_EXHAUSTED: - case ACE_Scheduler::ST_TASK_ALREADY_REGISTERED: - default: - delete rt_info[0]; - delete[] rt_info; - ACE_ERROR ((LM_ERROR, - "Config_Scheduler::create - register_task failed\n")); - // TODO: throw something. - break; - } - return handle; -} - -RtecScheduler::handle_t -ACE_Config_Scheduler::lookup (const char * entry_point, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - RtecScheduler::RT_Info* rt_info = 0; - switch (impl->get_rt_info (entry_point, rt_info)) - { - case ACE_Scheduler::SUCCEEDED: - return rt_info->handle; - break; - case ACE_Scheduler::FAILED: - case ACE_Scheduler::ST_UNKNOWN_TASK: - default: - ACE_ERROR ((LM_ERROR, - "Config_Scheduler::lookup - get_rt_info failed\n")); - // TODO: throw something. - break; - } - return -1; -} - -RtecScheduler::RT_Info* -ACE_Config_Scheduler::get (RtecScheduler::handle_t handle, - CORBA::Environment &_env) - ACE_THROW_SPEC((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK)) -{ - RtecScheduler::RT_Info* rt_info = 0; - switch (impl->lookup_rt_info (handle, rt_info)) - { - case ACE_Scheduler::SUCCEEDED: - { - // IDL memory managment semantics require the we return a copy - RtecScheduler::RT_Info* copy; - ACE_NEW_RETURN (copy, RtecScheduler::RT_Info (*rt_info), 0); - return copy; - } - break; - case ACE_Scheduler::FAILED: - case ACE_Scheduler::ST_UNKNOWN_TASK: - default: - ACE_ERROR ((LM_ERROR, - "Config_Scheduler::get - lookup_rt_info failed\n")); - // TODO: throw something. - break; - } - return 0; -} - -void ACE_Config_Scheduler::set (RtecScheduler::handle_t handle, - RtecScheduler::Time time, - RtecScheduler::Time typical_time, - RtecScheduler::Time cached_time, - RtecScheduler::Period period, - RtecScheduler::Importance importance, - RtecScheduler::Quantum quantum, - CORBA::Long threads, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK)) -{ - RtecScheduler::RT_Info* rt_info = 0; - switch (impl->lookup_rt_info (handle, rt_info)) - { - case ACE_Scheduler::SUCCEEDED: - rt_info->worst_case_execution_time = time; - rt_info->typical_execution_time = typical_time; - rt_info->cached_execution_time = cached_time; - rt_info->period = period; - rt_info->importance = importance; - rt_info->quantum = quantum; - rt_info->threads = threads; - break; - case ACE_Scheduler::FAILED: - case ACE_Scheduler::ST_UNKNOWN_TASK: - default: - ACE_ERROR ((LM_ERROR, - "Config_Scheduler::set - lookup_rt_info failed\n")); - // TODO: throw something. - break; - } -} - -void ACE_Config_Scheduler::priority (RtecScheduler::handle_t handle, - RtecScheduler::OS_Priority& priority, - RtecScheduler::Sub_Priority& subpriority, - RtecScheduler::Preemption_Priority& p_priority, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK, - RtecScheduler::NOT_SCHEDULED)) -{ - if (impl->priority (handle, priority, subpriority, p_priority) == -1) - { - ACE_ERROR ((LM_ERROR, - "Config_Scheduler::priority - priority failed\n")); - // TODO: throw something. - } -} - -void ACE_Config_Scheduler::entry_point_priority (const char * entry_point, - RtecScheduler::OS_Priority& priority, - RtecScheduler::Sub_Priority& subpriority, - RtecScheduler::Preemption_Priority& p_priority, - CORBA::Environment &_env) - ACE_THROW_SPEC((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK, - RtecScheduler::NOT_SCHEDULED)) -{ - this->priority (lookup (entry_point, _env), - priority, subpriority, p_priority, - _env); -} - -void ACE_Config_Scheduler::add_dependency (RtecScheduler::handle_t handle, - RtecScheduler::handle_t dependency, - CORBA::Long number_of_calls, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK)) -{ - RtecScheduler::RT_Info* rt_info = 0; - switch (impl->lookup_rt_info (handle, rt_info)) - { - case ACE_Scheduler::SUCCEEDED: - { - RtecScheduler::Dependency_Info dep; - dep.rt_info = dependency; - dep.number_of_calls = number_of_calls; - ACE_Scheduler::add_dependency(rt_info, dep); - } - break; - case ACE_Scheduler::FAILED: - case ACE_Scheduler::ST_UNKNOWN_TASK: - default: - ACE_ERROR ((LM_ERROR, - "cannot find %d to add dependency", handle)); - // TODO: throw something. - break; - } -} - -void ACE_Config_Scheduler::compute_scheduling (CORBA::Long minimum_priority, - CORBA::Long maximum_priority, - RtecScheduler::RT_Info_Set_out infos, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::UTILIZATION_BOUND_EXCEEDED, - RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS, - RtecScheduler::TASK_COUNT_MISMATCH)) -{ - impl->init (minimum_priority, maximum_priority); - if (impl->schedule () != ACE_Scheduler::SUCCEEDED) - { - // TODO: throw something. - ACE_ERROR ((LM_ERROR, "schedule failed\n")); - return; - } - if (infos == 0) - { - infos = new RtecScheduler::RT_Info_Set(impl->tasks ()); - } - infos->length (impl->tasks ()); - for (RtecScheduler::handle_t handle = 1; - handle <= impl->tasks (); - ++handle) - { - RtecScheduler::RT_Info* rt_info = 0; - switch (impl->lookup_rt_info (handle, rt_info)) - { - case ACE_Scheduler::SUCCEEDED: - // We know that handles start at 1. - infos[handle - 1] = *rt_info; - break; - case ACE_Scheduler::FAILED: - case ACE_Scheduler::ST_UNKNOWN_TASK: - default: - ACE_ERROR ((LM_ERROR, - "Config_Scheduler::schedule - lookup_rt_info failed\n")); - // TODO: throw something. - break; - } - } - ACE_DEBUG ((LM_DEBUG, "schedule prepared\n")); -} diff --git a/TAO/local/bin/Scheduling_Service/Config_Scheduler.h b/TAO/local/bin/Scheduling_Service/Config_Scheduler.h deleted file mode 100644 index 7da2739d2ec..00000000000 --- a/TAO/local/bin/Scheduling_Service/Config_Scheduler.h +++ /dev/null @@ -1,94 +0,0 @@ -// ============================================================================ -// -// $Id$ -// -// ============================================================================ - -#ifndef ACE_CONFIG_SCHEDULER_H -#define ACE_CONFIG_SCHEDULER_H - -#include <ace/OS.h> - -#include "RtecSchedulerS.h" -#include "Event_Service_Constants.h" - -class ACE_Config_Scheduler -: public POA_RtecScheduler::Scheduler - // = TITLE - // A (local) implementation for the RtecScheduler::Scheduler service. - // - // = DESCRIPTION - // This class implements a servant for the - // RtecScheduler::Scheduler service, using the Scheduler classes - // distributed with the EC. -{ -public: - ACE_Config_Scheduler (void); - virtual ~ACE_Config_Scheduler (void); - - virtual RtecScheduler::handle_t create (const char * entry_point, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::DUPLICATE_NAME)); - - virtual RtecScheduler::handle_t lookup (const char * entry_point, - CORBA::Environment &_env) - ACE_THROW_SPEC((CORBA::SystemException)); - - virtual RtecScheduler::RT_Info* get (RtecScheduler::handle_t handle, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK)); - - virtual void set (RtecScheduler::handle_t handle, - RtecScheduler::Time time, - RtecScheduler::Time typical_time, - RtecScheduler::Time cached_time, - RtecScheduler::Period period, - RtecScheduler::Importance importance, - RtecScheduler::Quantum quantum, - CORBA::Long threads, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK)); - - virtual void priority (RtecScheduler::handle_t handle, - RtecScheduler::OS_Priority& priority, - RtecScheduler::Sub_Priority& subpriority, - RtecScheduler::Preemption_Priority& p_priority, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK, - RtecScheduler::NOT_SCHEDULED)); - - virtual void entry_point_priority (const char * entry_point, - RtecScheduler::OS_Priority& priority, - RtecScheduler::Sub_Priority& subpriority, - RtecScheduler::Preemption_Priority& p_priority, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK, - RtecScheduler::NOT_SCHEDULED)); - - virtual void add_dependency (RtecScheduler::handle_t handle, - RtecScheduler::handle_t dependency, - CORBA::Long number_of_calls, - CORBA::Environment &_env) - ACE_THROW_SPEC ((CORBA::SystemException, - RtecScheduler::UNKNOWN_TASK)); - - virtual void compute_scheduling (CORBA::Long minimum_priority, - CORBA::Long maximum_priority, - RtecScheduler::RT_Info_Set_out infos, - CORBA::Environment &_env) - ACE_THROW_SPEC((CORBA::SystemException, - RtecScheduler::UTILIZATION_BOUND_EXCEEDED, - RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS, - RtecScheduler::TASK_COUNT_MISMATCH)); - -private: - class ACE_Scheduler* impl; -}; - -#if defined (__ACE_INLINE__) -#include "Config_Scheduler.i" -#endif /* __ACE_INLINE__ */ - -#endif /* ACE_CONFIG_SCHEDULER_H */ diff --git a/TAO/local/bin/Scheduling_Service/Config_Scheduler.i b/TAO/local/bin/Scheduling_Service/Config_Scheduler.i deleted file mode 100644 index a21ea7f9897..00000000000 --- a/TAO/local/bin/Scheduling_Service/Config_Scheduler.i +++ /dev/null @@ -1,5 +0,0 @@ -// ============================================================================ -// -// $Id$ -// -// ============================================================================ diff --git a/TAO/local/bin/Scheduling_Service/Makefile b/TAO/local/bin/Scheduling_Service/Makefile deleted file mode 100644 index cb31ad2deab..00000000000 --- a/TAO/local/bin/Scheduling_Service/Makefile +++ /dev/null @@ -1,752 +0,0 @@ -# -# $Id$ -# - -BIN = schedule_service dump_schedule -BUILD = $(BIN) - -SCHEDULE_SRCS = \ - schedule_service.cpp \ - Config_Scheduler.cpp \ - Scheduler.cpp \ - Scheduler_Internal.cpp -DUMP_SRCS = \ - dump_schedule.cpp - -LSRC = $(SCHEDULE_SRCS) \ - $(DUMP_SRCS) - -SCHEDULE_OBJS=$(SCHEDULE_SRCS:.cpp=.o) -DUMP_OBJS=$(DUMP_SRCS:.cpp=.o) - -LDLIBS = -lorbsvcs -lTAO -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -ifndef TAO_ROOT -TAO_ROOT = $(ACE_ROOT)/TAO -endif -TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE -DCFLAGS = -g -LDFLAGS += -L$(TAO_ROOT)/orbsvcs/lib -L$(TAO_ROOT)/tao -CPPFLAGS += -I$(TAO_ROOT)/orbsvcs/lib -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H - -schedule_service: $(addprefix $(VDIR),$(SCHEDULE_OBJS)) - $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) - -dump_schedule: $(addprefix $(VDIR),$(DUMP_OBJS)) - $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) - - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/schedule_service.o .shobj/schedule_service.: schedule_service.cpp \ - $(ACE_ROOT)/ace/CORBA_Handler.h \ - $(ACE_ROOT)/ace/Service_Config.h \ - $(ACE_ROOT)/ace/Service_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/stdcpp.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Shared_Object.i \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Service_Object.i \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Service_Config.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ - $(ACE_ROOT)/ace/Pipe.h \ - $(ACE_ROOT)/ace/Pipe.i \ - $(TAO_ROOT)/tao/corba.h \ - $(ACE_ROOT)/ace/Get_Opt.h \ - $(ACE_ROOT)/ace/Get_Opt.i \ - $(ACE_ROOT)/ace/SOCK_Stream.h \ - $(ACE_ROOT)/ace/SOCK_IO.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_IO.i \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK_Stream.i \ - $(ACE_ROOT)/ace/Hash_Map_Manager.h \ - $(ACE_ROOT)/ace/SString.h \ - $(ACE_ROOT)/ace/SString.i \ - $(ACE_ROOT)/ace/SOCK_Acceptor.h \ - $(ACE_ROOT)/ace/Time_Value.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.i \ - $(ACE_ROOT)/ace/SOCK_Connector.h \ - $(ACE_ROOT)/ace/SOCK_Connector.i \ - $(ACE_ROOT)/ace/Strategies.h \ - $(ACE_ROOT)/ace/Strategies_T.h \ - $(ACE_ROOT)/ace/Synch_Options.h \ - $(ACE_ROOT)/ace/Connector.h \ - $(ACE_ROOT)/ace/Map_Manager.h \ - $(ACE_ROOT)/ace/Map_Manager.i \ - $(ACE_ROOT)/ace/Svc_Handler.h \ - $(ACE_ROOT)/ace/Task.h \ - $(ACE_ROOT)/ace/Thread_Manager.h \ - $(ACE_ROOT)/ace/Thread_Manager.i \ - $(ACE_ROOT)/ace/Task.i \ - $(ACE_ROOT)/ace/Task_T.h \ - $(ACE_ROOT)/ace/Message_Queue.h \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ - $(ACE_ROOT)/ace/Message_Queue.i \ - $(ACE_ROOT)/ace/Task_T.i \ - $(ACE_ROOT)/ace/Dynamic.h \ - $(ACE_ROOT)/ace/Dynamic.i \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Svc_Handler.i \ - $(ACE_ROOT)/ace/Connector.i \ - $(ACE_ROOT)/ace/Acceptor.h \ - $(ACE_ROOT)/ace/Acceptor.i \ - $(TAO_ROOT)/tao/orbconf.h \ - $(TAO_ROOT)/tao/orb.h \ - $(TAO_ROOT)/tao/corbacom.h \ - $(TAO_ROOT)/tao/object.h \ - $(TAO_ROOT)/tao/align.h \ - $(TAO_ROOT)/tao/sequence.h \ - $(TAO_ROOT)/tao/varout.h \ - $(TAO_ROOT)/tao/any.h \ - $(TAO_ROOT)/tao/poa.h \ - $(TAO_ROOT)/tao/tao_internals.h \ - $(TAO_ROOT)/tao/params.h \ - $(TAO_ROOT)/tao/client_factory.h \ - $(TAO_ROOT)/tao/server_factory.h \ - $(TAO_ROOT)/tao/default_client.h \ - $(TAO_ROOT)/tao/default_server.h \ - $(TAO_ROOT)/tao/except.h \ - $(TAO_ROOT)/tao/orbobj.h \ - $(TAO_ROOT)/tao/nvlist.h \ - $(TAO_ROOT)/tao/principa.h \ - $(TAO_ROOT)/tao/request.h \ - $(TAO_ROOT)/tao/svrrqst.h \ - $(TAO_ROOT)/tao/typecode.h \ - $(TAO_ROOT)/tao/marshal.h \ - $(TAO_ROOT)/tao/cdr.h \ - $(TAO_ROOT)/tao/stub.h \ - $(TAO_ROOT)/tao/connect.h \ - $(TAO_ROOT)/tao/orb_core.h \ - $(TAO_ROOT)/tao/objtable.h \ - $(TAO_ROOT)/tao/optable.h \ - $(TAO_ROOT)/tao/debug.h \ - $(TAO_ROOT)/tao/iiopobj.h \ - $(TAO_ROOT)/tao/iioporb.h \ - $(TAO_ROOT)/tao/giop.h \ - $(TAO_ROOT)/tao/orb_core.i \ - $(ACE_ROOT)/ace/Dynamic_Service.h \ - $(TAO_ROOT)/tao/corbacom.i \ - $(TAO_ROOT)/tao/sequence.i \ - $(TAO_ROOT)/tao/typecode.i \ - $(TAO_ROOT)/tao/any.i \ - $(TAO_ROOT)/tao/cdr.i \ - $(TAO_ROOT)/tao/stub.i \ - $(TAO_ROOT)/tao/object.i \ - $(TAO_ROOT)/tao/orbobj.i \ - $(TAO_ROOT)/tao/marshal.i \ - $(TAO_ROOT)/tao/poa.i \ - $(TAO_ROOT)/tao/giop.i \ - $(TAO_ROOT)/tao/iioporb.i \ - $(TAO_ROOT)/tao/iiopobj.i \ - $(TAO_ROOT)/tao/params.i \ - $(TAO_ROOT)/tao/server_factory.i \ - $(TAO_ROOT)/tao/default_client.i \ - $(TAO_ROOT)/tao/default_server.i \ - $(TAO_ROOT)/tao/connect.i \ - $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.i \ - Config_Scheduler.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerS.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.i \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerS.i \ - $(TAO_ROOT)/orbsvcs/lib/Event_Service_Constants.h \ - Config_Scheduler.i -.obj/Config_Scheduler.o .shobj/Config_Scheduler.: Config_Scheduler.cpp Scheduler_Internal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/stdcpp.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Containers.i \ - Scheduler.h \ - $(ACE_ROOT)/ace/Map_Manager.h \ - $(ACE_ROOT)/ace/Map_Manager.i \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/SString.h \ - $(ACE_ROOT)/ace/SString.i \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.h \ - $(TAO_ROOT)/tao/corba.h \ - $(ACE_ROOT)/ace/Get_Opt.h \ - $(ACE_ROOT)/ace/Get_Opt.i \ - $(ACE_ROOT)/ace/SOCK_Stream.h \ - $(ACE_ROOT)/ace/SOCK_IO.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_IO.i \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK_Stream.i \ - $(ACE_ROOT)/ace/Hash_Map_Manager.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.h \ - $(ACE_ROOT)/ace/Time_Value.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.i \ - $(ACE_ROOT)/ace/SOCK_Connector.h \ - $(ACE_ROOT)/ace/SOCK_Connector.i \ - $(ACE_ROOT)/ace/Strategies.h \ - $(ACE_ROOT)/ace/Strategies_T.h \ - $(ACE_ROOT)/ace/Service_Config.h \ - $(ACE_ROOT)/ace/Service_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.i \ - $(ACE_ROOT)/ace/Service_Object.i \ - $(ACE_ROOT)/ace/Service_Config.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ - $(ACE_ROOT)/ace/Synch_Options.h \ - $(ACE_ROOT)/ace/Connector.h \ - $(ACE_ROOT)/ace/Svc_Handler.h \ - $(ACE_ROOT)/ace/Task.h \ - $(ACE_ROOT)/ace/Thread_Manager.h \ - $(ACE_ROOT)/ace/Thread_Manager.i \ - $(ACE_ROOT)/ace/Task.i \ - $(ACE_ROOT)/ace/Task_T.h \ - $(ACE_ROOT)/ace/Message_Queue.h \ - $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ - $(ACE_ROOT)/ace/Message_Queue.i \ - $(ACE_ROOT)/ace/Task_T.i \ - $(ACE_ROOT)/ace/Dynamic.h \ - $(ACE_ROOT)/ace/Dynamic.i \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Svc_Handler.i \ - $(ACE_ROOT)/ace/Connector.i \ - $(ACE_ROOT)/ace/Acceptor.h \ - $(ACE_ROOT)/ace/Acceptor.i \ - $(TAO_ROOT)/tao/orbconf.h \ - $(TAO_ROOT)/tao/orb.h \ - $(TAO_ROOT)/tao/corbacom.h \ - $(TAO_ROOT)/tao/object.h \ - $(TAO_ROOT)/tao/align.h \ - $(TAO_ROOT)/tao/sequence.h \ - $(TAO_ROOT)/tao/varout.h \ - $(TAO_ROOT)/tao/any.h \ - $(TAO_ROOT)/tao/poa.h \ - $(TAO_ROOT)/tao/tao_internals.h \ - $(TAO_ROOT)/tao/params.h \ - $(TAO_ROOT)/tao/client_factory.h \ - $(TAO_ROOT)/tao/server_factory.h \ - $(TAO_ROOT)/tao/default_client.h \ - $(TAO_ROOT)/tao/default_server.h \ - $(TAO_ROOT)/tao/except.h \ - $(TAO_ROOT)/tao/orbobj.h \ - $(TAO_ROOT)/tao/nvlist.h \ - $(TAO_ROOT)/tao/principa.h \ - $(TAO_ROOT)/tao/request.h \ - $(TAO_ROOT)/tao/svrrqst.h \ - $(TAO_ROOT)/tao/typecode.h \ - $(TAO_ROOT)/tao/marshal.h \ - $(TAO_ROOT)/tao/cdr.h \ - $(TAO_ROOT)/tao/stub.h \ - $(TAO_ROOT)/tao/connect.h \ - $(TAO_ROOT)/tao/orb_core.h \ - $(TAO_ROOT)/tao/objtable.h \ - $(TAO_ROOT)/tao/optable.h \ - $(TAO_ROOT)/tao/debug.h \ - $(TAO_ROOT)/tao/iiopobj.h \ - $(TAO_ROOT)/tao/iioporb.h \ - $(TAO_ROOT)/tao/giop.h \ - $(TAO_ROOT)/tao/orb_core.i \ - $(ACE_ROOT)/ace/Dynamic_Service.h \ - $(TAO_ROOT)/tao/corbacom.i \ - $(TAO_ROOT)/tao/sequence.i \ - $(TAO_ROOT)/tao/typecode.i \ - $(TAO_ROOT)/tao/any.i \ - $(TAO_ROOT)/tao/cdr.i \ - $(TAO_ROOT)/tao/stub.i \ - $(TAO_ROOT)/tao/object.i \ - $(TAO_ROOT)/tao/orbobj.i \ - $(TAO_ROOT)/tao/marshal.i \ - $(TAO_ROOT)/tao/poa.i \ - $(TAO_ROOT)/tao/giop.i \ - $(TAO_ROOT)/tao/iioporb.i \ - $(TAO_ROOT)/tao/iiopobj.i \ - $(TAO_ROOT)/tao/params.i \ - $(TAO_ROOT)/tao/server_factory.i \ - $(TAO_ROOT)/tao/default_client.i \ - $(TAO_ROOT)/tao/default_server.i \ - $(TAO_ROOT)/tao/connect.i \ - $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.i \ - $(TAO_ROOT)/orbsvcs/lib/Event_Service_Constants.h \ - Scheduler.i Scheduler_Internal.i Config_Scheduler.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerS.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerS.i \ - Config_Scheduler.i -.obj/Scheduler.o .shobj/Scheduler.: Scheduler.cpp \ - $(ACE_ROOT)/ace/Sched_Params.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/stdcpp.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Sched_Params.i \ - Scheduler_Internal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - Scheduler.h \ - $(ACE_ROOT)/ace/Map_Manager.h \ - $(ACE_ROOT)/ace/Map_Manager.i \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/SString.h \ - $(ACE_ROOT)/ace/SString.i \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.h \ - $(TAO_ROOT)/tao/corba.h \ - $(ACE_ROOT)/ace/Get_Opt.h \ - $(ACE_ROOT)/ace/Get_Opt.i \ - $(ACE_ROOT)/ace/SOCK_Stream.h \ - $(ACE_ROOT)/ace/SOCK_IO.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_IO.i \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK_Stream.i \ - $(ACE_ROOT)/ace/Hash_Map_Manager.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.h \ - $(ACE_ROOT)/ace/Time_Value.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.i \ - $(ACE_ROOT)/ace/SOCK_Connector.h \ - $(ACE_ROOT)/ace/SOCK_Connector.i \ - $(ACE_ROOT)/ace/Strategies.h \ - $(ACE_ROOT)/ace/Strategies_T.h \ - $(ACE_ROOT)/ace/Service_Config.h \ - $(ACE_ROOT)/ace/Service_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.i \ - $(ACE_ROOT)/ace/Service_Object.i \ - $(ACE_ROOT)/ace/Service_Config.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ - $(ACE_ROOT)/ace/Synch_Options.h \ - $(ACE_ROOT)/ace/Connector.h \ - $(ACE_ROOT)/ace/Svc_Handler.h \ - $(ACE_ROOT)/ace/Task.h \ - $(ACE_ROOT)/ace/Thread_Manager.h \ - $(ACE_ROOT)/ace/Thread_Manager.i \ - $(ACE_ROOT)/ace/Task.i \ - $(ACE_ROOT)/ace/Task_T.h \ - $(ACE_ROOT)/ace/Message_Queue.h \ - $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ - $(ACE_ROOT)/ace/Message_Queue.i \ - $(ACE_ROOT)/ace/Task_T.i \ - $(ACE_ROOT)/ace/Dynamic.h \ - $(ACE_ROOT)/ace/Dynamic.i \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Svc_Handler.i \ - $(ACE_ROOT)/ace/Connector.i \ - $(ACE_ROOT)/ace/Acceptor.h \ - $(ACE_ROOT)/ace/Acceptor.i \ - $(TAO_ROOT)/tao/orbconf.h \ - $(TAO_ROOT)/tao/orb.h \ - $(TAO_ROOT)/tao/corbacom.h \ - $(TAO_ROOT)/tao/object.h \ - $(TAO_ROOT)/tao/align.h \ - $(TAO_ROOT)/tao/sequence.h \ - $(TAO_ROOT)/tao/varout.h \ - $(TAO_ROOT)/tao/any.h \ - $(TAO_ROOT)/tao/poa.h \ - $(TAO_ROOT)/tao/tao_internals.h \ - $(TAO_ROOT)/tao/params.h \ - $(TAO_ROOT)/tao/client_factory.h \ - $(TAO_ROOT)/tao/server_factory.h \ - $(TAO_ROOT)/tao/default_client.h \ - $(TAO_ROOT)/tao/default_server.h \ - $(TAO_ROOT)/tao/except.h \ - $(TAO_ROOT)/tao/orbobj.h \ - $(TAO_ROOT)/tao/nvlist.h \ - $(TAO_ROOT)/tao/principa.h \ - $(TAO_ROOT)/tao/request.h \ - $(TAO_ROOT)/tao/svrrqst.h \ - $(TAO_ROOT)/tao/typecode.h \ - $(TAO_ROOT)/tao/marshal.h \ - $(TAO_ROOT)/tao/cdr.h \ - $(TAO_ROOT)/tao/stub.h \ - $(TAO_ROOT)/tao/connect.h \ - $(TAO_ROOT)/tao/orb_core.h \ - $(TAO_ROOT)/tao/objtable.h \ - $(TAO_ROOT)/tao/optable.h \ - $(TAO_ROOT)/tao/debug.h \ - $(TAO_ROOT)/tao/iiopobj.h \ - $(TAO_ROOT)/tao/iioporb.h \ - $(TAO_ROOT)/tao/giop.h \ - $(TAO_ROOT)/tao/orb_core.i \ - $(ACE_ROOT)/ace/Dynamic_Service.h \ - $(TAO_ROOT)/tao/corbacom.i \ - $(TAO_ROOT)/tao/sequence.i \ - $(TAO_ROOT)/tao/typecode.i \ - $(TAO_ROOT)/tao/any.i \ - $(TAO_ROOT)/tao/cdr.i \ - $(TAO_ROOT)/tao/stub.i \ - $(TAO_ROOT)/tao/object.i \ - $(TAO_ROOT)/tao/orbobj.i \ - $(TAO_ROOT)/tao/marshal.i \ - $(TAO_ROOT)/tao/poa.i \ - $(TAO_ROOT)/tao/giop.i \ - $(TAO_ROOT)/tao/iioporb.i \ - $(TAO_ROOT)/tao/iiopobj.i \ - $(TAO_ROOT)/tao/params.i \ - $(TAO_ROOT)/tao/server_factory.i \ - $(TAO_ROOT)/tao/default_client.i \ - $(TAO_ROOT)/tao/default_server.i \ - $(TAO_ROOT)/tao/connect.i \ - $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.i \ - $(TAO_ROOT)/orbsvcs/lib/Event_Service_Constants.h \ - Scheduler.i Scheduler_Internal.i -.obj/Scheduler_Internal.o .shobj/Scheduler_Internal.: Scheduler_Internal.cpp \ - \ - \ - $(ACE_ROOT)/ace/Sched_Params.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/stdcpp.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Sched_Params.i \ - Scheduler_Internal.h \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - Scheduler.h \ - $(ACE_ROOT)/ace/Map_Manager.h \ - $(ACE_ROOT)/ace/Map_Manager.i \ - $(ACE_ROOT)/ace/Message_Block.h \ - $(ACE_ROOT)/ace/Malloc.h \ - $(ACE_ROOT)/ace/Malloc.i \ - $(ACE_ROOT)/ace/Malloc_T.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Free_List.h \ - $(ACE_ROOT)/ace/Free_List.i \ - $(ACE_ROOT)/ace/Malloc_T.i \ - $(ACE_ROOT)/ace/Memory_Pool.h \ - $(ACE_ROOT)/ace/Signal.h \ - $(ACE_ROOT)/ace/Signal.i \ - $(ACE_ROOT)/ace/Object_Manager.h \ - $(ACE_ROOT)/ace/Object_Manager.i \ - $(ACE_ROOT)/ace/Managed_Object.h \ - $(ACE_ROOT)/ace/Managed_Object.i \ - $(ACE_ROOT)/ace/Mem_Map.h \ - $(ACE_ROOT)/ace/Mem_Map.i \ - $(ACE_ROOT)/ace/Memory_Pool.i \ - $(ACE_ROOT)/ace/Message_Block.i \ - $(ACE_ROOT)/ace/SString.h \ - $(ACE_ROOT)/ace/SString.i \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.h \ - $(TAO_ROOT)/tao/corba.h \ - $(ACE_ROOT)/ace/Get_Opt.h \ - $(ACE_ROOT)/ace/Get_Opt.i \ - $(ACE_ROOT)/ace/SOCK_Stream.h \ - $(ACE_ROOT)/ace/SOCK_IO.h \ - $(ACE_ROOT)/ace/SOCK.h \ - $(ACE_ROOT)/ace/Addr.h \ - $(ACE_ROOT)/ace/Addr.i \ - $(ACE_ROOT)/ace/IPC_SAP.h \ - $(ACE_ROOT)/ace/IPC_SAP.i \ - $(ACE_ROOT)/ace/SOCK.i \ - $(ACE_ROOT)/ace/SOCK_IO.i \ - $(ACE_ROOT)/ace/INET_Addr.h \ - $(ACE_ROOT)/ace/INET_Addr.i \ - $(ACE_ROOT)/ace/SOCK_Stream.i \ - $(ACE_ROOT)/ace/Hash_Map_Manager.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.h \ - $(ACE_ROOT)/ace/Time_Value.h \ - $(ACE_ROOT)/ace/SOCK_Acceptor.i \ - $(ACE_ROOT)/ace/SOCK_Connector.h \ - $(ACE_ROOT)/ace/SOCK_Connector.i \ - $(ACE_ROOT)/ace/Strategies.h \ - $(ACE_ROOT)/ace/Strategies_T.h \ - $(ACE_ROOT)/ace/Service_Config.h \ - $(ACE_ROOT)/ace/Service_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.h \ - $(ACE_ROOT)/ace/Shared_Object.i \ - $(ACE_ROOT)/ace/Service_Object.i \ - $(ACE_ROOT)/ace/Service_Config.i \ - $(ACE_ROOT)/ace/Reactor.h \ - $(ACE_ROOT)/ace/Handle_Set.h \ - $(ACE_ROOT)/ace/Handle_Set.i \ - $(ACE_ROOT)/ace/Timer_Queue.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.h \ - $(ACE_ROOT)/ace/Timer_Queue_T.i \ - $(ACE_ROOT)/ace/Reactor.i \ - $(ACE_ROOT)/ace/Reactor_Impl.h \ - $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ - $(ACE_ROOT)/ace/Synch_Options.h \ - $(ACE_ROOT)/ace/Connector.h \ - $(ACE_ROOT)/ace/Svc_Handler.h \ - $(ACE_ROOT)/ace/Task.h \ - $(ACE_ROOT)/ace/Thread_Manager.h \ - $(ACE_ROOT)/ace/Thread_Manager.i \ - $(ACE_ROOT)/ace/Task.i \ - $(ACE_ROOT)/ace/Task_T.h \ - $(ACE_ROOT)/ace/Message_Queue.h \ - $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ - $(ACE_ROOT)/ace/Message_Queue.i \ - $(ACE_ROOT)/ace/Task_T.i \ - $(ACE_ROOT)/ace/Dynamic.h \ - $(ACE_ROOT)/ace/Dynamic.i \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Svc_Handler.i \ - $(ACE_ROOT)/ace/Connector.i \ - $(ACE_ROOT)/ace/Acceptor.h \ - $(ACE_ROOT)/ace/Acceptor.i \ - $(TAO_ROOT)/tao/orbconf.h \ - $(TAO_ROOT)/tao/orb.h \ - $(TAO_ROOT)/tao/corbacom.h \ - $(TAO_ROOT)/tao/object.h \ - $(TAO_ROOT)/tao/align.h \ - $(TAO_ROOT)/tao/sequence.h \ - $(TAO_ROOT)/tao/varout.h \ - $(TAO_ROOT)/tao/any.h \ - $(TAO_ROOT)/tao/poa.h \ - $(TAO_ROOT)/tao/tao_internals.h \ - $(TAO_ROOT)/tao/params.h \ - $(TAO_ROOT)/tao/client_factory.h \ - $(TAO_ROOT)/tao/server_factory.h \ - $(TAO_ROOT)/tao/default_client.h \ - $(TAO_ROOT)/tao/default_server.h \ - $(TAO_ROOT)/tao/except.h \ - $(TAO_ROOT)/tao/orbobj.h \ - $(TAO_ROOT)/tao/nvlist.h \ - $(TAO_ROOT)/tao/principa.h \ - $(TAO_ROOT)/tao/request.h \ - $(TAO_ROOT)/tao/svrrqst.h \ - $(TAO_ROOT)/tao/typecode.h \ - $(TAO_ROOT)/tao/marshal.h \ - $(TAO_ROOT)/tao/cdr.h \ - $(TAO_ROOT)/tao/stub.h \ - $(TAO_ROOT)/tao/connect.h \ - $(TAO_ROOT)/tao/orb_core.h \ - $(TAO_ROOT)/tao/objtable.h \ - $(TAO_ROOT)/tao/optable.h \ - $(TAO_ROOT)/tao/debug.h \ - $(TAO_ROOT)/tao/iiopobj.h \ - $(TAO_ROOT)/tao/iioporb.h \ - $(TAO_ROOT)/tao/giop.h \ - $(TAO_ROOT)/tao/orb_core.i \ - $(ACE_ROOT)/ace/Dynamic_Service.h \ - $(TAO_ROOT)/tao/corbacom.i \ - $(TAO_ROOT)/tao/sequence.i \ - $(TAO_ROOT)/tao/typecode.i \ - $(TAO_ROOT)/tao/any.i \ - $(TAO_ROOT)/tao/cdr.i \ - $(TAO_ROOT)/tao/stub.i \ - $(TAO_ROOT)/tao/object.i \ - $(TAO_ROOT)/tao/orbobj.i \ - $(TAO_ROOT)/tao/marshal.i \ - $(TAO_ROOT)/tao/poa.i \ - $(TAO_ROOT)/tao/giop.i \ - $(TAO_ROOT)/tao/iioporb.i \ - $(TAO_ROOT)/tao/iiopobj.i \ - $(TAO_ROOT)/tao/params.i \ - $(TAO_ROOT)/tao/server_factory.i \ - $(TAO_ROOT)/tao/default_client.i \ - $(TAO_ROOT)/tao/default_server.i \ - $(TAO_ROOT)/tao/connect.i \ - $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.i \ - $(TAO_ROOT)/orbsvcs/lib/Event_Service_Constants.h \ - Scheduler.i Scheduler_Internal.i -.obj/dump_schedule.o .shobj/dump_schedule.: dump_schedule.cpp \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.i \ - $(TAO_ROOT)/orbsvcs/lib/Scheduler_Factory.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.h \ - $(TAO_ROOT)/orbsvcs/lib/RtecSchedulerC.i \ - $(TAO_ROOT)/orbsvcs/lib/Scheduler_Factory.i - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/local/bin/Scheduling_Service/Scheduler.cpp b/TAO/local/bin/Scheduling_Service/Scheduler.cpp deleted file mode 100644 index b71e0679469..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler.cpp +++ /dev/null @@ -1,291 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler.cpp -// -// = CREATION DATE -// 23 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -#include "ace/Sched_Params.h" -#include "Scheduler.h" - -#if ! defined (__ACE_INLINE__) -#include "Scheduler.i" -#endif /* __ACE_INLINE__ */ - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// class Scheduler static members -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -const ACE_Scheduler::mode_t ACE_Scheduler::CURRENT_MODE = 0xFFFFFFFF; - -ACE_Scheduler *ACE_Scheduler::instance_ = 0; - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// class ACE_Scheduler static functions -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -void -ACE_Scheduler::output (FILE *file, const status_t status) -{ - switch (status) - { - case NOT_SCHEDULED : - ACE_OS::fprintf (file, "NOT_SCHEDULED"); - break; - case SUCCEEDED : - ACE_OS::fprintf (file, "SUCCEEDED"); - break; - case ST_TASK_ALREADY_REGISTERED : - ACE_OS::fprintf (file, "TASK_ALREADY_REGISTERED"); - break; - case ST_VIRTUAL_MEMORY_EXHAUSTED : - ACE_OS::fprintf (file, "VIRTUAL_MEMORY_EXHAUSTED"); - break; - case ST_UNKNOWN_TASK : - ACE_OS::fprintf (file, "UNKNOWN_TASK"); - break; - case INVALID_MODE : - ACE_OS::fprintf (file, "INVALID_MODE"); - break; - case MODE_COUNT_MISMATCH : - ACE_OS::fprintf (file, "MODE_COUNT_MISMATCH"); - break; - case TASK_COUNT_MISMATCH : - ACE_OS::fprintf (file, "TASK_COUNT_MISMATCH"); - break; - case INVALID_PRIORITY : - ACE_OS::fprintf (file, "INVALID_PRIORITY"); - break; - - // The following are only used during scheduling (in the case of - // off-line scheduling, they are only used prior to runtime). - // To save a little code space (280 bytes on g++ 2.7.2/Solaris 2.5.1), - // we could conditionally compile them so that they're not in the - // runtime version. - case ST_UTILIZATION_BOUND_EXCEEDED : - ACE_OS::fprintf (file, "UTILIZATION_BOUND_EXCEEDED"); - break; - case ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS : - ACE_OS::fprintf (file, "INSUFFICIENT_THREAD_PRIORITY_LEVELS"); - break; - case ST_CYCLE_IN_DEPENDENCIES : - ACE_OS::fprintf (file, "CYCLE_IN_DEPENDENCIES"); - break; - case UNABLE_TO_OPEN_SCHEDULE_FILE : - ACE_OS::fprintf (file, "UNABLE_TO_OPEN_SCHEDULE_FILE"); - break; - case UNABLE_TO_WRITE_SCHEDULE_FILE : - ACE_OS::fprintf (file, "UNABLE_TO_WRITE_SCHEDULE_FILE"); - break; - // End of config-only status values. - - default: - ACE_OS::fprintf (file, "UNKNOWN STATUS: %d", status); - } -} - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// class ACE_Scheduler member functions -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -ACE_Scheduler::ACE_Scheduler () : - minimum_priority_queue_ (0), // Could initialize this to -1, but it's - // unsigned and we don't really need to - // distinguish between no queues and one - // queue. - modes_ (0), - tasks_ (0), - threads_ (0), - mode_ (0), - status_ (NOT_SCHEDULED), - output_level_ (0) -{ -} - - -ACE_Scheduler::~ACE_Scheduler () -{ -} - - -// ************************************************************ - -ACE_Scheduler::status_t -ACE_Scheduler::get_rt_info (Object_Name name, - RT_Info* &rtinfo) -{ - handle_t handle; - - // This makes a copy. We can optimize this with our own string - // class. - ACE_CString lookup (name); - // Search the map for the <name>. If found, return the RT_Info. - RT_Info **info_array = 0; - if (info_collection_.find (lookup, info_array) >= 0) - { - rtinfo = info_array[0]; - // If we find it, return. - return SUCCEEDED; - } - else - // Otherwise, make one, bind it, and register it. - { - rtinfo = new RT_Info; - rtinfo->entry_point = name; - // Create and array (size one) of RT_Info* - info_array = new RT_Info*[1]; - info_array[0] = rtinfo; - // Bind the rtinfo to the name. - if (info_collection_.bind (lookup, info_array) != 0) - { - delete rtinfo; - delete info_array; - rtinfo = 0; - return FAILED; // Error! - } - else - { - // Register the array. - status_t result = this->register_task (info_array, 1, handle); - if (result == SUCCEEDED) - { - rtinfo->handle = handle; - return ST_UNKNOWN_TASK; // Didn't find it, but made one! - } - else - { - rtinfo->handle = 0; - return FAILED; - } - } - } -} - - - -int ACE_Scheduler::number_of_dependencies(RT_Info* rt_info) -{ - return rt_info->dependencies.length(); -} - -int ACE_Scheduler::number_of_dependencies(RT_Info& rt_info) -{ - return rt_info.dependencies.length(); -} - -int ACE_Scheduler::add_dependency(RT_Info* rt_info, - const Dependency_Info& d) -{ - ACE_DEBUG ((LM_DEBUG, "adding dependecy to: %s\n", - (const char*)rt_info->entry_point)); - RtecScheduler::Dependency_Set& set = rt_info->dependencies; - int l = set.length(); - set.length(l + 1); - set[l] = d; - return 0; -} - -void ACE_Scheduler::export(RT_Info* info, FILE* file) -{ - export(*info, file); -} - -void ACE_Scheduler::export(RT_Info& info, FILE* file) -{ - // The divide-by-1 is for ACE_U_LongLong support. - (void) ACE_OS::fprintf (file, - "%s\n%d\n%ld\n%ld\n%ld\n%ld\n%d\n%ld\n%u\n" - "# begin dependencies\n%d\n", - (const char*)info.entry_point, - info.handle, - info.worst_case_execution_time / 1, - info.typical_execution_time / 1, - info.cached_execution_time / 1, - info.period, - info.importance, - info.quantum / 1, - info.threads, - number_of_dependencies(info)); - - for (int i = 0; i < number_of_dependencies(info); ++i) - { - RT_Info tmp; - // TODO: info.dependencies [i].rt_info >>= &tmp; - (void) ACE_OS::fprintf (file, "%s, %d\n", - (const char*)tmp.entry_point, - info.dependencies[i].number_of_calls); - - } - - (void) ACE_OS::fprintf (file, "# end dependencies\n%d\n%d\n\n", - info.priority, - info.subpriority); - - -} - - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Lock_Adapter<ACE_Null_Mutex>; -template class ACE_Map_Entry<ACE_CString, ACE_Scheduler::RT_Info **>; - -#if defined (ACE_HAS_THREADS) - template class ACE_Lock_Adapter<ACE_RW_Thread_Mutex>; - template class ACE_Lock_Adapter<ACE_Thread_Mutex>; - template class ACE_Map_Manager<ACE_CString, - ACE_Scheduler::RT_Info **, - ACE_Thread_Mutex>; - template class ACE_Map_Iterator<ACE_CString, ACE_Scheduler::RT_Info **, - ACE_Thread_Mutex>; - template class ACE_Read_Guard<ACE_Thread_Mutex>; - template class ACE_Write_Guard<ACE_Thread_Mutex>; -#else - template class ACE_Map_Manager<ACE_CString, RT_Info **, - ACE_Null_Mutex>; - template class ACE_Map_Iterator<ACE_CString, RT_Info **, - ACE_Null_Mutex>; - template class ACE_Read_Guard<ACE_Null_Mutex>; - template class ACE_Write_Guard<ACE_Null_Mutex>; -#endif /* ACE_HAS_THREADS */ -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate class ACE_Lock_Adapter<ACE_Null_Mutex> -#pragma instantiate class ACE_Map_Entry<ACE_CString, RT_Info **> -#pragma instantiate class ACE_Singleton<ACE_Scheduler::TaskManager> - -#if defined (ACE_HAS_THREADS) -#pragma instantiate class ACE_Lock_Adapter<ACE_RW_Thread_Mutex> -#pragma instantiate class ACE_Lock_Adapter<ACE_Thread_Mutex> -#pragma instantiate class ACE_Map_Manager<ACE_CString, RT_Info **, ACE_Thread_Mutex> -#pragma instantiate class ACE_Map_Iterator<ACE_CString, RT_Info **, ACE_Thread_Mutex> -#pragma instantiate class ACE_Read_Guard<ACE_Thread_Mutex> -#pragma instantiate class ACE_Write_Guard<ACE_Thread_Mutex> -#else -#pragma instantiate class ACE_Map_Manager<ACE_CString, RT_Info **, ACE_Null_Mutex> -#pragma instantiate class ACE_Map_Iterator<ACE_CString, RT_Info **, ACE_Null_Mutex> -#pragma instantiate class ACE_Read_Guard<ACE_Null_Mutex> -#pragma instantiate class ACE_Write_Guard<ACE_Null_Mutex> -#endif /* ACE_HAS_THREADS */ - -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - -// EOF diff --git a/TAO/local/bin/Scheduling_Service/Scheduler.h b/TAO/local/bin/Scheduling_Service/Scheduler.h deleted file mode 100644 index c24d9f91f44..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler.h +++ /dev/null @@ -1,278 +0,0 @@ -/* -*- C++ -*- */ -// -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler.h -// -// = CREATION DATE -// 23 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -#if ! defined (SCHEDULER_H) -#define SCHEDULER_H - -#include "ace/ACE.h" -#include "ace/Map_Manager.h" -#include "ace/Message_Block.h" -#include "ace/Synch.h" -#include "ace/SString.h" - -#include "RtecSchedulerC.h" -#include "Event_Service_Constants.h" - -class ACE_Scheduler - // = TITLE - // Thread scheduler interface. - // - // = DESCRIPTION - // This virtual base class is the interface to either an off-line - // scheduler, or to the necessary on-line component of the Scheduler. -{ -public: - typedef u_int mode_t; - - typedef RtecScheduler::handle_t handle_t; - typedef RtecScheduler::Dependency_Info Dependency_Info; - typedef RtecScheduler::Preemption_Priority Preemption_Priority; - typedef RtecScheduler::OS_Priority OS_Thread_Priority; - typedef RtecScheduler::Sub_Priority Sub_Priority; - typedef RtecScheduler::RT_Info RT_Info; - // Map some types to simplify re-use. - - typedef const char *Object_Name; - // Objects are named by unique strings. - - static const mode_t CURRENT_MODE; - - enum status_t { - // The following are used both by the runtime Scheduler and during - // scheduling. - NOT_SCHEDULED = -1 // the schedule () method has not been called yet - , FAILED = -1 - , SUCCEEDED - , ST_UNKNOWN_TASK - , ST_TASK_ALREADY_REGISTERED - , ST_VIRTUAL_MEMORY_EXHAUSTED - - // The following are only used by the runtime Scheduler. - , INVALID_MODE - , MODE_COUNT_MISMATCH // only used by schedule () - , TASK_COUNT_MISMATCH // only used by schedule () - , INVALID_PRIORITY // only used by schedule (): mismatch of - // (off-line, maybe) Scheduler output to - // the runtime Scheduler component. - - // The following are only used during scheduling (in the case of - // off-line scheduling, they are only used prior to runtime). - , ST_UTILIZATION_BOUND_EXCEEDED - , ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS - , ST_CYCLE_IN_DEPENDENCIES - , UNABLE_TO_OPEN_SCHEDULE_FILE - , UNABLE_TO_WRITE_SCHEDULE_FILE - }; - - virtual ~ACE_Scheduler (); - - // = Utility function for outputting the textual representation of a - // status_t value to a FILE. - static void output (FILE *, const status_t); - - // = Initialize the scheduler. - virtual void init (const int minimum_priority, - const int maximum_priority, - const char *runtime_filename = 0, - const char *rt_info_filename = 0, - const char *timeline_filename = 0) = 0; - // The minimum and maximum priority are the OS-specific priorities that - // are used when creating the schedule (assigning priorities). The - // minimum_priority is the priority value of the lowest priority. - // It may be numerically higher than the maximum_priority, on OS's such - // as VxWorks that use lower values to indicate higher priorities. - // - // When Scheduler::schedule is called, the schedule is output to the - // file named by "runtime_filename" if it is non-zero. - // This file is compilable; it is linked into the runtime executable - // to provide priorities to the runtime scheduling component. - // If the "rt_info_filename" is non-zero, the RT_Info for - // every task is exported to it. It is not used at runtime. - // If the "timeline_filename" is non-zero, the timeline output - // file is created. It is not used at runtime. - // - // The runtime scheduling component ignores these filenames. It just - // uses the priorities that were linked in to the executable, after - // converting them to platform-specific values. - - // = Registers a task. - virtual status_t register_task (RT_Info *[], - const u_int number_of_modes, - handle_t &handle) = 0; - // If the Task registration succeeds, this function returns SUCCEEDED - // and sets "handle" to a unique identifier for the task. - // Otherwise, it returns either VIRTUAL_MEMORY_EXHAUSTED or - // TASK_ALREADY_REGISTERED sets the handle to 0. (A task may - // only be registered once.) - // The RT_Info * array is indexed by mode; there must be one element for - // each mode, as specified by number_of_modes. If a task does not - // run in a mode, then its entry in the array for that mode must - // be 0. - - virtual status_t get_rt_info (Object_Name name, - RT_Info* &rtinfo); - // Tries to find the RT_Info corresponding to <name> in the RT_Info - // database. Returns SUCCEEDED if <name> was found and <rtinfo> was - // set. Returns UNKNOWN_TASK if <name> was not found, but <rtinfo> - // was set to a newly allocated RT_Info. In this UNKNOWN_TASK case, - // the task must call RT_Info::set to fill in execution properties. - // In the SUCCEEDED and UNKNOWN_TASK cases, this->register_task - // (rtinfo, 0, handle) is called. Returns FAILED if an error - // occurs. - // - // One motivation for allocating RT_Info's from within the Scheduler - // is to allow RT_Infos to persist after the tasks that use them. - // For instance, we may want to call this->schedule right before the - // application exits a configuration run. If the tasks have been - // deleted (deleting their RT_Infos with them), this->schedule will - // fail. - - virtual status_t lookup_rt_info (handle_t handle, - RT_Info* &rtinfo) = 0; - // Obtains an RT_Info based on its "handle". - - // = Computes the schedule. - virtual status_t schedule (void) = 0; - // This actually generates the files. - - // = Access a thread priority. - virtual int priority (const handle_t handle, - OS_Thread_Priority &priority, - Sub_Priority &subpriority, - Preemption_Priority &preemption_prio, - const mode_t = CURRENT_MODE) const = 0; - // Defines "priority" as the priority that was assigned to the Task that - // was assigned "handle", for the specified mode. Defines "subpriority" - // as the relative ordering (due to dependencies) within the priority. - // Returns 0 on success, or -1 if an invalid mode or handle are supplied. - // Queue numbers are platform-independent priority values, ranging from - // a highest priority value of 0 to the lowest priority value, which is - // returned by "minimum_priority_queue ()". - - // = Access the platform-independent priority value of the lowest-priority - // thread. - u_int minimum_priority_queue () const { return minimum_priority_queue_; } - // This is intended for use by the Event Channel, so it can determine the - // number of priority dispatch queues to create. - - // = Access the number of modes. - u_int modes () const { return modes_; } - - // = Access the number of tasks. - u_int tasks () const { return tasks_; } - - // = Access the number of threads. - u_int threads () const { return threads_; } - - // = Access the current mode. - mode_t mode () const { return mode_; } - - // = Set the current mode. - void mode (const mode_t mode) { mode_ = mode; } - - // = Access the current scheduler status. - status_t status () const { return status_; } - - // = Access the current output (debugging) level. - u_int output_level () const { return output_level_; } - // Default is 0; set to 1 to print out schedule, by task. Set - // to higher than one for debugging info. - - // = Set the scheduler output (debugging) level. - void output_level (const u_int level) { output_level_ = level; } - // the only supported levels are 0 (quiet), 1 (verbose) and 2 - // (debug) - - static int add_dependency(RT_Info* rt_info, - const Dependency_Info& d); - - static int number_of_dependencies(RT_Info* rt_info); - static int number_of_dependencies(RT_Info& rt_info); - - static void export(RT_Info*, FILE* file); - static void export(RT_Info&, FILE* file); - -protected: - ACE_Scheduler (); - - // = Set the minimum priority value. - void minimum_priority_queue (const u_int minimum_priority_queue_number) - { minimum_priority_queue_ = minimum_priority_queue_number; } - - // = Set the number of modes. - void modes (const u_int modes) { modes_ = modes; } - - // = Set the number of tasks. - void tasks (const u_int tasks) { tasks_ = tasks; } - - // = Set the number of threads. - void threads (const u_int threads) { threads_ = threads; } - - // = Set the current scheduler status. - void status (const status_t new_status) { status_ = new_status; } - -private: - typedef ACE_CString EXT; - typedef RT_Info **INT; - -#if defined (ACE_HAS_THREADS) - typedef ACE_Thread_Mutex SYNCH; -#else - typedef ACE_Null_Mutex SYNCH; -#endif /* ACE_HAS_THREADS */ - - typedef ACE_Map_Manager<EXT, INT, SYNCH> Info_Collection; - typedef ACE_Map_Iterator<EXT, INT, SYNCH> Info_Collection_Iterator; - typedef ACE_Map_Entry<EXT, INT> Info_Collection_Entry; - - Info_Collection info_collection_; - // A binding of name to rt_info. This is the mapping for every - // rt_info in the process. - - static ACE_Scheduler *instance_; - - u_int minimum_priority_queue_; - // The platform-independent priority value of the Event Channel's - // minimum priority dispatch queue. The value of the maximum priority - // dispatch queue is always 0. - - u_int modes_; - u_int tasks_; - u_int threads_; - - mode_t mode_; - status_t status_; - u_int output_level_; - - // the following functions are not implememented - ACE_UNIMPLEMENTED_FUNC(ACE_Scheduler (const ACE_Scheduler &)) - ACE_UNIMPLEMENTED_FUNC(ACE_Scheduler &operator= (const ACE_Scheduler &)) -}; - -typedef ACE_Scheduler Scheduler; - -#if defined (__ACE_INLINE__) -#include "Scheduler.i" -#endif /* __ACE_INLINE__ */ - -#endif /* SCHEDULER_H */ - - -// EOF diff --git a/TAO/local/bin/Scheduling_Service/Scheduler.i b/TAO/local/bin/Scheduling_Service/Scheduler.i deleted file mode 100644 index 57875ae26d1..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler.i +++ /dev/null @@ -1,20 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler.i -// -// = CREATION DATE -// 23 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -// EOF - diff --git a/TAO/local/bin/Scheduling_Service/Scheduler_Generic.cpp b/TAO/local/bin/Scheduling_Service/Scheduler_Generic.cpp deleted file mode 100644 index 67f87d30cba..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler_Generic.cpp +++ /dev/null @@ -1,528 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler_Generic.cpp -// -// = CREATION DATE -// 19 November 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -#include "ace/Sched_Params.h" - -#include "Scheduler_Generic.h" - -#if ! defined (__ACE_INLINE__) -#include "Scheduler_Generic.i" -#endif /* __ACE_INLINE__ */ - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// static functions -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// Structure for storing the RT_Info information for each task, per mode. -struct Mode_Entry -{ - RtecScheduler::RT_Info *rt_info_; - u_long start_time_; // microseconds - u_long stop_time_; // microseconds - - Mode_Entry() : - rt_info_ (0), - start_time_ (0), - stop_time_ (0) - { - } - - Mode_Entry(RtecScheduler::RT_Info *const rt_info, - const u_long start_time = 0, - const u_long stop_time = 0) : - rt_info_ (rt_info), - start_time_ (start_time), - stop_time_ (stop_time) - { - } - - ~Mode_Entry () {} - - Mode_Entry &operator= (const Mode_Entry &entry) - { - if (this != &entry) - { - rt_info_ = entry.rt_info_; - start_time_ = entry.start_time_; - stop_time_ = entry.stop_time_; - } - - return *this; - } -}; - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// class Scheduler_Generic member functions -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -Scheduler_Generic::Scheduler_Generic () : - Scheduler (), - handles_ (0), - // Set the minimum priority to that for the current platform. This - // shouldn't be necessary, but UPSingleProcessorOrb::initialize_reactors - // creates threads before the Event Channel calls Scheduler::init (). - minimum_priority_ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, - ACE_SCOPE_THREAD)), - increasing_priority_ (-1), - task_entries_ () -{ -} - - -Scheduler_Generic::~Scheduler_Generic () -{ - reset (); -} - - -void -Scheduler_Generic::reset () -{ -} - -Scheduler::status_t -Scheduler_Generic::lookup_rt_info (handle_t handle, - RT_Info*& rtinfo) -{ - if (handle < 0 || (size_t) handle > task_entries_.size ()) - { - return ST_UNKNOWN_TASK; - } - RT_Info*** entry; - ACE_Unbounded_Set_Iterator <RT_Info **> i (task_entries_); - while (i.next (entry) != 0) - { - i.advance (); - RT_Info** array = *entry; - if (array[0]->handle == handle) - { - rtinfo = array[0]; - return SUCCEEDED; - } - } - - return ST_UNKNOWN_TASK; -} - - -Scheduler::status_t -Scheduler_Generic::register_task (RT_Info *rt_info [], - const u_int number_of_modes, - handle_t &handle) -{ - status_t ret; - - // try to store the new task's information . . . - switch (task_entries_.insert (rt_info)) - { - case 0 : // successfully inserted - { - rt_info [0]->handle = (handle = ++handles_); - - // assigned the same handle to the RT_Info for each of its modes - for (u_int i = 1; i < number_of_modes; ++i) - { - if (rt_info [i] != 0) - rt_info [i]->handle = handle; - } - - if (number_of_modes > modes ()) - { - modes (number_of_modes); - } - - ret = SUCCEEDED; - - if (output_level () >= 5) - { - ACE_OS::printf ("registered task \"%s\" with RT_Info starting " - "at %X\n", - (const char*)rt_info[0]->entry_point, - (void *) rt_info[0]); - } - } - break; - - case 1 : // the entry had already been inserted - handle = 0; - ret = ST_TASK_ALREADY_REGISTERED; - break; - - default : - // case -1 : insert failed, probably because virtual memory exhaused - handle = 0; - ret = ST_VIRTUAL_MEMORY_EXHAUSTED; - break; - } - - return ret; -} - - -void -Scheduler_Generic::init (const int minimum_priority, - const int maximum_priority, - const char *runtime_filename, - const char *rt_info_filename, - const char *timeline_filename) -{ - minimum_priority_ = minimum_priority; - maximum_priority_ = maximum_priority; - runtime_filename_ = runtime_filename; - rt_info_filename_ = rt_info_filename; - timeline_filename_ = timeline_filename; -} - - -Scheduler::status_t -Scheduler_Generic::schedule (void) -{ - ACE_Guard<LOCK> ace_mon (lock_); - - // here goes . . . - - increasing_priority_ = maximum_priority_ >= minimum_priority_; - - status_t status = NOT_SCHEDULED; - - // store number of tasks, based on registrations - tasks (task_entries_.size ()); - - if (output_level () > 0) - { - print_schedule (); - } - - if (runtime_filename_ != 0 && - (status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED)) - { - status = store_schedule (runtime_filename_); - } - - if ((status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED) && rt_info_filename_) - { - status = store_rt_info (rt_info_filename_); - } - - // If there was a failure, (try to) remove the output files. - if (! (status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED)) - { - if (runtime_filename_ && unlink ((char *) runtime_filename_) - && errno != ENOENT) - { - ACE_OS::perror ("Scheduler_Generic::schedule (); " - "unable to remove schedule file"); - } - if (rt_info_filename_ && unlink ((char *) rt_info_filename_) && - errno != ENOENT) - { - ACE_OS::perror ("Scheduler_Generic::schedule (); " - "unable to remove rt_info file"); - } - } - - return status; -} - - -int -Scheduler_Generic::priority (const handle_t handle, - OS_Thread_Priority &priority, - Sub_Priority &subpriority, - Preemption_Priority &preemption_prio, - const mode_t requested_mode) const -{ - ACE_UNUSED_ARG (handle); - ACE_UNUSED_ARG (requested_mode); - - priority = minimum_priority_; - subpriority = ACE_Scheduler_MIN_SUB_PRIORITY; - preemption_prio = ACE_Scheduler_MAX_PREEMPTION_PRIORITY; - - if (output_level () >= 3) - { - ACE_OS::printf ("preemption_prio %d: min %d, pri %d, min_pri %d\n", - preemption_prio, minimum_priority_queue (), - priority, minimum_priority_); - } - - return 0; -} - - -void -Scheduler_Generic::print_schedule () -{ -} - - -Scheduler::status_t -Scheduler_Generic::store_schedule (const char *filename) -{ - u_int i; - RT_Info ***entry; - FILE *const file = ACE_OS::fopen (filename, "w"); - - if (file) - { - ACE_OS::fprintf (file, "\ -// Automatically generated \"%s\"\n\ -\n\ -#include \"Scheduler_Runtime.h\"\n\ -\n\ -static const unsigned int MODES = %u;\n\ -static const unsigned int TASKS = %u;\n\ -static const unsigned int THREADS = %u;\n\ -static const unsigned int MINIMUM_PRIORITY_QUEUE = %u;\n\ -\n\ -int\n\ -Scheduler_Runtime_registered_tasks_ [TASKS] = { 0 };\n\ -\n\ -const char *\n\ -Scheduler_Runtime_task_names_ [TASKS] =\n\ - {\n\ -", filename, - modes (), - tasks (), - threads (), - minimum_priority_queue ()); - - ACE_Unbounded_Set_Iterator <RT_Info **> - task_entries_i (task_entries_); - i = 0; - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - ACE_OS::fprintf (file, " \"%s\"%s\n", - (const char*) (*entry) [0]->entry_point, - ++i == tasks () ? "" : ","); - } - - ACE_OS::fprintf (file, "\ - };\n\ -\n\ -int\n\ -Scheduler_Runtime_priorities_ [MODES][TASKS][3] =\n\ - {\n\ -"); - - for (i = 0; i < modes (); ++i) - { - ACE_OS::fprintf (file, " { /* mode %u */\n", i); - - ACE_Unbounded_Set_Iterator <RT_Info **> - task_entries_i (task_entries_); - u_int j = 0; - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - - RtecScheduler::OS_Priority priority; - RtecScheduler::Sub_Priority subpriority; - RtecScheduler::Preemption_Priority preemption_prio; - this->priority (0, priority, subpriority, preemption_prio, j); - - ACE_OS::fprintf (file, " \"%s\"%s\n", - (const char*) (*entry) [0]->entry_point, - j + 1 == tasks () ? "" : ","); - - ACE_OS::fprintf (file, " { %d, %d, %u }%s\n", - priority, - subpriority, - preemption_prio, - ++j == tasks () ? "" : ","); - } - ACE_OS::fprintf (file, " }%s /* end mode %u */\n", - i == modes () - 1 ? "" : ",", i); - } - - ACE_OS::fprintf (file, "\ - };\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::modes ()\n\ -{\n\ - return MODES;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::tasks ()\n\ -{\n\ - return TASKS;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::threads ()\n\ -{\n\ - return THREADS;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::minimum_priority_queue ()\n\ -{\n\ - return MINIMUM_PRIORITY_QUEUE;\n\ -}\n\ -\n\ -const char *\n\ -Scheduler_Runtime::task_name (const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_task_names_ [handle - 1];\n\ -}\n\ -\n\ -int\n\ -Scheduler_Runtime::priority (const unsigned int mode,\n\ - const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_priorities_ [mode][handle - 1][0];\n\ -}\n\ -\n\ -int\n\ -Scheduler_Runtime::subpriority (const unsigned int mode,\n\ - const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_priorities_ [mode][handle - 1][1];\n\ -}\n\ -\n\ -int\n\ -Scheduler_Runtime::preemption_prio (const unsigned int mode,\n\ - const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_priorities_ [mode][handle - 1][2];\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::config ()\n\ -{\n\ - return 0;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::find (const char *operation_name)\n\ -{\n\ - for (unsigned int i = 0; i < TASKS; ++i)\n\ - if (! ACE_OS::strcmp (operation_name,\n\ - Scheduler_Runtime_task_names_ [i]))\n\ - return i + 1;\n\ -\n\ - return 0;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::register_task (const unsigned int task)\n\ -{\n\ - if (Scheduler_Runtime_registered_tasks_ [task - 1] == 1)\n\ - {\n\ - return 0;\n\ - }\n\ - else\n\ - {\n\ - Scheduler_Runtime_registered_tasks_ [task - 1] = 1;\n\ - return task;\n\ - }\n\ -}\n\ -\n\ -"); - - if (ACE_OS::fprintf (file, "// EOF\n") > 0 && - ACE_OS::fclose (file) == 0) - { - return SUCCEEDED; - } - else - { - return UNABLE_TO_WRITE_SCHEDULE_FILE; - } - } - else - { - return UNABLE_TO_OPEN_SCHEDULE_FILE; - } -} - - -Scheduler::status_t -Scheduler_Generic::store_rt_info (const char *filename) -{ - FILE *file = ACE_OS::fopen (filename, "w"); - if (file) - { - const time_t now = ACE_OS::time (0); - - (void) ACE_OS::fprintf (file, - "# RT_Info provided for \"%s\" %s" - "# Version 1.1\n" - "# Format for each entry:\n" - "# entry name\n" - "# handle\n" - "# worst case execution time\n" - "# typical execution time\n" - "# cached execution time\n" - "# period\n" - "# importance\n" - "# quantum\n" - "# begin dependencies\n" - "# number of dependencies\n" - "# entry name, number of calls " - "(one of these lines per dependency, if any)\n" - "# end dependencies\n" - "# priority\n" - "# order within priority\n\n" - "%u modes\n%u operations\n\n", - filename, ACE_OS::ctime (&now), - modes (), tasks ()); - - RT_Info ***entry; - ACE_Unbounded_Set_Iterator <RT_Info **> - task_entries_i (task_entries_); - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - export ((*entry) [0], file); - } - } - else - { - return UNABLE_TO_OPEN_SCHEDULE_FILE; - } - - if (ACE_OS::fprintf (file, "\n# end of file\n", 1) > 0 && - ACE_OS::fclose (file) == 0) - { - return SUCCEEDED; - } - else - { - return UNABLE_TO_WRITE_SCHEDULE_FILE; - } -} - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Node<RtecScheduler::RT_Info **>; -template class ACE_Unbounded_Set<RtecScheduler::RT_Info **>; -template class ACE_Unbounded_Set_Iterator<RtecScheduler::RT_Info **>; -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - -// EOF diff --git a/TAO/local/bin/Scheduling_Service/Scheduler_Generic.h b/TAO/local/bin/Scheduling_Service/Scheduler_Generic.h deleted file mode 100644 index 37c09f6b12d..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler_Generic.h +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler_Generic.h -// -// = CREATION DATE -// 19 November 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -#if ! defined (SCHEDULER_INTERNAL_H) -#define SCHEDULER_INTERNAL_H - -#include "Scheduler.h" - -class Scheduler_Generic : public ACE_Scheduler - // = TITLE - // Implementation of an off-line scheduler. - // - // = DESCRIPTION - // Schedules tasks, assigning the same priority to all of them. -{ -public: - Scheduler_Generic (); - virtual ~Scheduler_Generic (); - - // = Initialize the scheduler. - virtual void init (const int minimum_priority, - const int maximum_priority, - const char *runtime_filename = 0, - const char *rt_info_filename = 0, - const char *timeline_filename = 0); - - // = Registers a task. - virtual status_t register_task (RT_Info *[], - const u_int number_of_modes, - handle_t &handle); - - virtual status_t lookup_rt_info (handle_t handle, - RT_Info* &rtinfo); - // Obtains an RT_Info based on its "handle". - - // = Computes the schedule. - virtual status_t schedule (void); - - // = Access a thread priority. - virtual int priority (const handle_t handle, - OS_Thread_Priority &priority, - Sub_Priority &subpriority, - Preemption_Priority &preemption_prio, - const mode_t = CURRENT_MODE) const; - // Defines "priority" as the priority that was assigned to the Task that - // was assigned "handle", for the specified mode. Defines "subpriority" - // as the relative ordering (due to dependencies) within the priority. - // Returns 0 on success, or 1 if an invalid mode or handle are supplied. - -private: - u_int handles_; - // The number of task handles dispensed so far. - - int minimum_priority_; - // The minimum priority value that the application specified (in - // its call to init ()). - - int maximum_priority_; - // The maximum priority value that the application specified (in - // its call to init ()). - - const char *runtime_filename_; - // Destination file of Scheduler output from the configuration run. - - const char *rt_info_filename_; - // Destination file of all rt_info data from the configuration run. - - const char *timeline_filename_; - // The destination of the timeline. - - int increasing_priority_; - // Set to 1 if priority values increase with increasing priority, - // such as on Solaris and Win32, or 0 if they decrease, such as on - // VxWorks. - - ACE_Unbounded_Set <RT_Info **> task_entries_; - // Collection of known tasks. - -#if defined (ACE_HAS_THREADS) - typedef ACE_Recursive_Thread_Mutex LOCK; -#else - typedef ACE_Null_Mutex LOCK; -#endif /* ACE_HAS_THREADS */ - - LOCK lock_; - // This protects access to the scheduler during configuration runs. - - - /////////////////////////////////////// - // member functions for internal use // - /////////////////////////////////////// - - void reset (); - // Prepare for another schedule computation, but do not - // disturb the "output" (priorities that have already been assigned). - - void print_schedule (); - // Display the schedule, task-by-task. - - status_t store_schedule (const char *filename); - // Store the schedule in the named file. - - status_t store_rt_info (const char *filename); - // Export all RT_Info to the named file. - - ACE_UNIMPLEMENTED_FUNC (Scheduler_Generic (const Scheduler_Generic &)) - ACE_UNIMPLEMENTED_FUNC (Scheduler_Generic &operator= ( - const Scheduler_Generic &)) -}; - - -#if defined (__ACE_INLINE__) -#include "Scheduler_Generic.i" -#endif /* __ACE_INLINE__ */ - -#endif /* SCHEDULER_INTERNAL_H */ - - -// EOF diff --git a/TAO/local/bin/Scheduling_Service/Scheduler_Generic.i b/TAO/local/bin/Scheduling_Service/Scheduler_Generic.i deleted file mode 100644 index 71e3695dc35..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler_Generic.i +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler_Generic.i -// -// = CREATION DATE -// 23 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - - -// EOF - diff --git a/TAO/local/bin/Scheduling_Service/Scheduler_Internal.cpp b/TAO/local/bin/Scheduling_Service/Scheduler_Internal.cpp deleted file mode 100644 index e112ab50c9f..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler_Internal.cpp +++ /dev/null @@ -1,2332 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler_Internal.cpp -// -// = CREATION DATE -// 23 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -#include "math.h" // for ::pow () -#include "float.h" // for DBL_EPSILON - -#include "ace/Sched_Params.h" - -#include "Scheduler_Internal.h" - -#if ! defined (__ACE_INLINE__) -#include "Scheduler_Internal.i" -#endif /* __ACE_INLINE__ */ - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// static functions -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -// Structure for storing the RT_Info information for each task, per mode. -struct Mode_Entry -{ - RtecScheduler::RT_Info *rt_info_; - u_long start_time_; // microseconds - u_long stop_time_; // microseconds - - Mode_Entry() : - rt_info_ (0), - start_time_ (0), - stop_time_ (0) - { - } - - Mode_Entry(RtecScheduler::RT_Info *const rt_info, - const u_long start_time = 0, - const u_long stop_time = 0) : - rt_info_ (rt_info), - start_time_ (start_time), - stop_time_ (stop_time) - { - } - - ~Mode_Entry () {} - - Mode_Entry &operator= (const Mode_Entry &entry) - { - if (this != &entry) - { - rt_info_ = entry.rt_info_; - start_time_ = entry.start_time_; - stop_time_ = entry.stop_time_; - } - - return *this; - } -}; - - -// "Add" an RT_Info to another. -static RtecScheduler::RT_Info& -operator+= (RtecScheduler::RT_Info *rt_info1, - const RtecScheduler::RT_Info &rt_info2) -{ - rt_info1->worst_case_execution_time = (rt_info1->worst_case_execution_time - + rt_info2.worst_case_execution_time); - rt_info1->typical_execution_time = (rt_info1->typical_execution_time - + rt_info2.typical_execution_time); - rt_info1->cached_execution_time = (rt_info1->cached_execution_time - + rt_info2.cached_execution_time); - - if ((rt_info1->period > rt_info2.period && rt_info2.period > 0) - || rt_info1->period <= 0) - { - rt_info1->period = rt_info2.period; - } - - return *rt_info1; -} - - -// Sort the threads into the sorted_rt_info array, -// by decreasing (non-increasing, actually) period. -// Returns the number of tasks in the input set. -static -void -sort (Scheduler_Internal::Thread_Map &threads, - u_long number_of_threads, - Mode_Entry sorted_rt_info [], - u_int output_level) -{ - u_int tasks = 0; - - ACE_OS::memset (sorted_rt_info, 0, (size_t) number_of_threads); - - // Iterate over each of the RT_Info entries that we know about, - // sorting the entries by decreasing (non-increasing) period. - Scheduler_Internal::Thread_Map_Entry *entry; - Scheduler_Internal::Thread_Map_Iterator i (threads); - while (i.next (entry)) - { - i.advance (); - RtecScheduler::RT_Info &rt_info = *entry->int_id_; - const RtecScheduler::Time entry_time = rt_info.worst_case_execution_time; - const RtecScheduler::Period entry_period = rt_info.period; - - if (output_level >= 1) - { - ACE_OS::printf ("Thread \"%s\"; utilization is %g and period is %ld" - " usec (%g Hz)\n", - (const char*)rt_info.entry_point, - entry_period > 0 -#if defined (ACE_WIN32) || defined (ACE_HAS_LONGLONG_T) - ? (double) entry_time / entry_period -#else - ? (double) entry_time.lo () / entry_period -#endif /* ACE_WIN32 || ACE_HAS_LONGLONG_T */ - : 0, - entry_period / 10 /* usec/100 ns */, - entry_period > 0 - ? 1.0e7 /* 1/100 ns */ / entry_period - : 0.0); - } - - // Use selection sort to sort entries by period. It's O (n^2), but n - // shouldn't be very big. - u_int j; - for (j = 0; j < tasks; ++j) - { - if (entry_period > sorted_rt_info [j].rt_info_->period) - { - // Found a smaller period: since we are sorting by decreasing - // period, need to insert the current period here. - - if (output_level >= 2) - { - ACE_OS::printf ("insert task before task %u with period %ld\n", - j + 1, - sorted_rt_info [j].rt_info_->period / - 10 /* usec/100 ns */); - } - - // insert this entry into the sort list here - for (u_int k = tasks; k > j; --k) - { - sorted_rt_info [k] = sorted_rt_info [k - 1]; - } - sorted_rt_info [j].rt_info_ = &rt_info; - - break; - } - } - if (j >= tasks) - { - // The entry does not have a lower period than any that we've - // already seen, so append it to the end of the sorted RT_Info array. - if (output_level >= 2) - { - ACE_OS::printf ("insert task with period %ld at end of sorted " - "array\n", - entry_period / 10 /* usec/100 ns */); - } - sorted_rt_info [j].rt_info_ = &rt_info; - } - - ++tasks; - } -} - - -// Check for harmonically related periods by comparing this entry's period -// with that of each of the other entries for integral division. -// As a side effect, figures out the frame_size, in microsec. -static -int -harmonically_related_periods (Mode_Entry const sorted_rt_info [], - const u_int number_of_tasks, - u_long &frame_size) -{ - int harmonically_related = 1; - u_int i; - - if (number_of_tasks > 0) - { - // start frame_size with the longest period - - for (i = 0; i < number_of_tasks; ++i) - frame_size = (u_long) (sorted_rt_info [0].rt_info_->period / - 10 /* microsec/100 ns */); - } - - for (i = 0; i < number_of_tasks - 1; ++i) - { - // Skip over groups of array entries with the same period. - while (i > 0 && i < number_of_tasks - 1 && - sorted_rt_info [i].rt_info_->period == - sorted_rt_info [i - 1].rt_info_->period) - { - ++i; - } - - // Compare the current RT_Info entry, at location i in the - // sorted array, to each of the remoining (with higher array index) - // entries. - for (u_int j = i + 1; j < number_of_tasks; ++j) - { - // if the period is 0, skip the task - if (sorted_rt_info [j].rt_info_->period <= 0) - break; - - // Assumes that the sorted_rt_info array is in decreasing - // (non-increasing) order. - double quotient = (double) sorted_rt_info [i].rt_info_->period / - sorted_rt_info [j].rt_info_->period; - - if (quotient - (long) quotient > DBL_EPSILON) - { - harmonically_related = 0; - - // and add another factor to the frame_size - frame_size *= (u_long) (sorted_rt_info [i].rt_info_->period / - 10 /* microseconds/100 ns */); - } - } - } - - return harmonically_related; -} - - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// class Scheduler_Internal member functions -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -Scheduler_Internal::Scheduler_Internal () : - Scheduler (), - handles_ (0), - // Set the minimum priority to that for the current platform. This - // shouldn't be necessary, but UPSingleProcessorOrb::initialize_reactors - // creates threads before the Event Channel calls Scheduler::init (). - minimum_priority_ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, - ACE_SCOPE_THREAD)), - increasing_priority_ (-1), - task_entries_ (), - ordered_info_ (0), - visited_ (0), - dependencies_ (0), - roots_ (0), - frame_size_ (0), - thread_info_ (0), - leaf_info_ (0), - timeline_ (0) -{ -} - - -Scheduler_Internal::~Scheduler_Internal () -{ - reset (); - - delete [] timeline_; - timeline_ = 0; - - for (u_int current_mode = 0; current_mode < modes (); ++current_mode) - { - // Iterate over each of the thread_info_ entries and delete them. - Thread_Map_Entry *entry; - Thread_Map_Iterator i (thread_info_ [current_mode]); - while (i.next (entry)) - { - i.advance (); - thread_info_ [current_mode].unbind (entry->ext_id_); - delete entry->int_id_; - } - } - - for (u_int task = 0; task < tasks (); ++task) - { - delete [] ordered_info_ [task]; - } - - delete [] thread_info_; - thread_info_ = 0; - - delete [] ordered_info_; - ordered_info_ = 0; - - delete [] frame_size_; - frame_size_ = 0; -} - - -void -Scheduler_Internal::reset () -{ - delete dependencies_; - dependencies_ = 0; - - delete roots_; - roots_ = 0; - - delete leaf_info_; - leaf_info_ = 0; -} - -Scheduler::status_t -Scheduler_Internal::lookup_rt_info (handle_t handle, - RT_Info*& rtinfo) -{ - if (handle < 0 || handle > task_entries_.size ()) - { - return ST_UNKNOWN_TASK; - } - RT_Info*** entry; - ACE_Unbounded_Set_Iterator <RT_Info **> i (task_entries_); - while (i.next (entry) != 0) - { - i.advance (); - RT_Info** array = *entry; - if (array[0]->handle == handle) - { - rtinfo = array[0]; - return SUCCEEDED; - } - } - - return ST_UNKNOWN_TASK; -} - - -Scheduler::status_t -Scheduler_Internal::register_task (RT_Info *rt_info [], - const u_int number_of_modes, - handle_t &handle) -{ - status_t ret; - - // try to store the new task's information . . . - switch (task_entries_.insert (rt_info)) - { - case 0 : // successfully inserted - { - rt_info [0]->handle = (handle = ++handles_); - - // assigned the same handle to the RT_Info for each of its modes - for (u_int i = 1; i < number_of_modes; ++i) - { - if (rt_info [i] != 0) - rt_info [i]->handle = handle; - } - - if (number_of_modes > modes ()) - { - modes (number_of_modes); - } - - ret = SUCCEEDED; - - if (output_level () >= 5) - { - ACE_OS::printf ("registered task \"%s\" with RT_Info starting " - "at %X\n", - (const char*)rt_info[0]->entry_point, - (void *) rt_info[0]); - } - } - break; - - case 1 : // the entry had already been inserted - handle = 0; - ret = ST_TASK_ALREADY_REGISTERED; - break; - - default : - // case -1 : insert failed, probably because virtual memory exhaused - handle = 0; - ret = ST_VIRTUAL_MEMORY_EXHAUSTED; - break; - } - - return ret; -} - - -void -Scheduler_Internal::init (const int minimum_priority, - const int maximum_priority, - const char *runtime_filename, - const char *rt_info_filename, - const char *timeline_filename) -{ - minimum_priority_ = minimum_priority; - maximum_priority_ = maximum_priority; - runtime_filename_ = runtime_filename; - rt_info_filename_ = rt_info_filename; - timeline_filename_ = timeline_filename; -} - - -Scheduler::status_t -Scheduler_Internal::schedule (void) -{ - ACE_Guard<LOCK> ace_mon (lock_); - - // here goes . . . - - increasing_priority_ = maximum_priority_ >= minimum_priority_; - - status_t status = NOT_SCHEDULED; - - // store number of tasks, based on registrations - tasks (task_entries_.size ()); - - // allocate tables . . . - ACE_NEW_RETURN (ordered_info_, RT_Info **[tasks ()], - ST_VIRTUAL_MEMORY_EXHAUSTED); - for (u_int task = 0; task < tasks (); ++task) - { - ACE_NEW_RETURN (ordered_info_ [task], RT_Info *[modes ()], - ST_VIRTUAL_MEMORY_EXHAUSTED); - ACE_OS::memset (ordered_info_ [task], 0, - sizeof (RT_Info *) * modes ()); - } - - ACE_NEW_RETURN (thread_info_, Thread_Map [modes ()], - ST_VIRTUAL_MEMORY_EXHAUSTED); - - ACE_NEW_RETURN (frame_size_, u_long [modes ()], - ST_VIRTUAL_MEMORY_EXHAUSTED); - - // set up timeline structure - if (timeline_filename_ != 0) - { - ACE_NEW_RETURN (timeline_, - ACE_Unbounded_Queue <Timeline_Entry> [modes()], - ST_VIRTUAL_MEMORY_EXHAUSTED); - } - - for (u_int current_mode = 0; current_mode < modes (); ++current_mode) - { - // set the current mode - mode (current_mode); - - status_t mode_status = NOT_SCHEDULED; - - // Identify threads and store information in convenient form for later - // use. - if ((mode_status = identify_threads ()) != SUCCEEDED) - { - return mode_status; // should only happen if virtual memory exceeded - } - - // Traverse task dependencies to aggregate thread parameters. - if ((mode_status = aggregate_thread_parameters ()) != SUCCEEDED) - { - return mode_status; // should only happen if virtual memory exceeded - } - - // only RMS is currently supported - if ((mode_status = schedule_rms (minimum_priority_, - maximum_priority_)) == SUCCEEDED) - { - if (status == NOT_SCHEDULED) status = SUCCEEDED; - } - else - { - status = mode_status; - } - } - - if (output_level () > 0) - { - print_schedule (); - } - - if (runtime_filename_ != 0 && - (status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED)) - { - status = store_schedule (runtime_filename_); - } - - if (timeline_filename_ != 0 && - (status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED)) - { - status = create_timelines (timeline_filename_); - } - - if ((status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED) && rt_info_filename_) - { - status = store_rt_info (rt_info_filename_); - } - - // If there was a failure, (try to) remove the output files. - if (! (status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED)) - { - if (runtime_filename_ && unlink ((char *) runtime_filename_) - && errno != ENOENT) - { - ACE_OS::perror ("Scheduler_Internal::schedule (); " - "unable to remove schedule file"); - } - if (rt_info_filename_ && unlink ((char *) rt_info_filename_) && - errno != ENOENT) - { - ACE_OS::perror ("Scheduler_Internal::schedule (); " - "unable to remove rt_info file"); - } - } - - return status; -} - - -Scheduler::status_t -Scheduler_Internal::update_dependencies (RT_Info &rt_info, - Sub_Priority subpriority) -{ - u_int i = 0; - - // Detect cycles in the dependency graph by storing (the address of) - // each RT_Info instance as it is visited. Then, on every visit, - // check to see if the instance had already been visited. Flag it, - // if so (and stop the recursion :-). - - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies; visiting \"%s\"", - (const char*)rt_info.entry_point); - } - - switch (visited_->insert (&rt_info)) - { - case -1 : - return ST_VIRTUAL_MEMORY_EXHAUSTED; - case 0 : - // successfully inserted - break; - case 1 : - default : - // oops, had already visited this rt_info! -#if 0 /* Ignore, it seems to work well without this check */ - return CYCLE_IN_DEPENDENCIES; -#else - break; -#endif /* 0 */ - } - - Scheduler::status_t ret = NOT_SCHEDULED; - - if (rt_info.priority == -1) - { - // Just updating the subpriority. - - int *ordered_deps = 0; - int *marked = 0; - - // Sort the dependencies by importance, lowest first. - ACE_NEW_RETURN (ordered_deps, int [number_of_dependencies (rt_info)], - ST_VIRTUAL_MEMORY_EXHAUSTED); - ACE_NEW_RETURN (marked, int [number_of_dependencies (rt_info)], - ST_VIRTUAL_MEMORY_EXHAUSTED); - for (i = 0; i < number_of_dependencies (rt_info); ++i) - { - ordered_deps [i] = -1; - marked [i] = 0; - } - - for (i = 0; i < number_of_dependencies (rt_info); ++i) - { - Sub_Priority current_importance = 0x7FFF; - int current_importance_dep = -1; - - // Find the unmarked dependent with the lowest importances. - for (u_int j = 0; j < number_of_dependencies (rt_info); ++j) - { - ACE_ASSERT (rt_info.dependencies[j].rt_info != -1); - RT_Info* info; - this->lookup_rt_info (rt_info.handle, info); - if (! marked [j] && - info->importance <= current_importance) - { - current_importance = info->importance; - current_importance_dep = j; - } - } - - ACE_ASSERT (current_importance_dep != -1); - ordered_deps [i] = current_importance_dep; - marked [current_importance_dep] = 1; - } - - if (output_level () >= 5) - { - ACE_OS::printf ("\"%s\" has %d dependencies\n", - (const char*)rt_info.entry_point, - number_of_dependencies(rt_info)); - for (i = 0; i < number_of_dependencies(rt_info); ++i) - { - RT_Info* info; - this->lookup_rt_info (rt_info.dependencies[ordered_deps[i]].rt_info, info); - ACE_OS::printf ("ordered dependency %d: \"%s\" (importance: %d)\n", - i, - (const char*)info->entry_point, - info->importance); - } - } - - // Traverse the dependent tasks, in order of importance. - for (i = 0; i < number_of_dependencies (rt_info); ++i) - { - RT_Info* dep_info; - this->lookup_rt_info (rt_info.dependencies[ordered_deps[i]].rt_info, - dep_info); - if (i > 0) - { - RT_Info* previous_info; - this->lookup_rt_info (rt_info.dependencies[ordered_deps [i-1]].rt_info, - previous_info); - if (previous_info->importance < dep_info->importance) - { - // Increment subpriority based on increased importance - // of this dependent. - ++subpriority; - } - } - - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies (); " - "incremented subpriority to %u\n", - subpriority); - } - - dep_info->subpriority = subpriority; - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies (); " - "set subpriority of \"%s\"o %u\n", - (const char*)dep_info->entry_point, - subpriority); - } - - // Recurse until all dependent tasks have been visited. - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies (); " - "calling recursively for dependent \"%s\"\n", - (const char*)dep_info->entry_point); - } - - if ((ret = update_dependencies (*dep_info, - subpriority + 1)) != NOT_SCHEDULED) - { - break; - } - } - - delete [] ordered_deps; - delete [] marked; - } - else - { - for (i = 0; i < number_of_dependencies (rt_info); ++i) - { - RT_Info* info; - this->lookup_rt_info (rt_info.dependencies[i].rt_info, info); - info->priority = rt_info.priority; - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies (); " - "set priority of \"%s\" to %d " - "(its subpriority is %u)\n", - (const char*)info->entry_point, - info->priority, - info->subpriority); - } - - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies (); " - "calling recursively for dependent \"%s\"\n", - (const char*)info->entry_point); - } - - // Recurse until all dependent tasks have been visited. - if ((ret = update_dependencies (*info, - 0 /* not used when - setting priorities */)) != - NOT_SCHEDULED) - { - break; - } - } - } - - return ret; -} - - -Scheduler::status_t -Scheduler_Internal::schedule_rms (const int minimum_priority, - const int maximum_priority) -{ - double utilization = 0.0; - u_int i; - - // Allocate an array for the sorted RT_Info. - Mode_Entry *sorted_rt_info; - ACE_NEW_RETURN (sorted_rt_info, Mode_Entry [threads ()], - ST_VIRTUAL_MEMORY_EXHAUSTED); - - // Sort the threads' thread info entries by period. - sort (thread_info_ [mode ()], threads (), sorted_rt_info, output_level ()); - - // Load priorities by walking the sorted rt_info_array, incrementing - // current_priority for each new period (rate). For threads af the same - // rate, assign subpriorities based on 1) data dependencies and - // 2) importance. Also, calculate CPU utilization on the fly. - ACE_Sched_Priority current_priority = minimum_priority; - for (i = 0; i < threads (); ++i) - { - RT_Info &rt_info = *sorted_rt_info [i].rt_info_; - const RtecScheduler::Time entry_time = rt_info.worst_case_execution_time; - const RtecScheduler::Period entry_period = rt_info.period; - - if (entry_period > DBL_EPSILON) - { -#if defined (ACE_WIN32) || defined (ACE_HAS_LONGLONG_T) - utilization += (double) entry_time / entry_period; -#else - utilization += (double) entry_time.lo () / entry_period; -#endif /* ACE_WIN32 || ACE_HAS_LONGLONG_T */ - } - - if (i != 0 && output_level () >= 3) - { - - ACE_OS::printf ("entry_period: %d (\"%s\"), " - "previous thread period: %d\n", - entry_period, - (const char*)sorted_rt_info [i].rt_info_->entry_point, - sorted_rt_info [i - 1].rt_info_->period); - } - - // If i == 0, we're at the starting point: there are no other threads - // to compare to. - if (i != 0 && entry_period != sorted_rt_info [i - 1].rt_info_->period) - { - // If the period of this task is the same as the period of the - // previous task (the threads are sorted by period), then assign - // it the same ("current") priority. Otherwise, assign a higher - // priority (which may have a lower value), via "current_priority". - if (current_priority == maximum_priority) - { - status (ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS); - } - else - { - if (output_level () >= 3) - { - ACE_OS::printf ("will advance current_priority from its " - "current %d for period of %d\n", - current_priority, entry_period); - } - - if (increasing_priority_) - { - // This assumes that the target and host are the - // same platform! It's hear to deal with the - // non-contiguous OS priorities of Win32 platforms. - current_priority = - ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, - current_priority, - ACE_SCOPE_PROCESS); - } - else - { - // This assumes that the OS priorities on the target - // are contiguous, e.g., 255, 254, 253, 252, etc., - // from low to high priority. The only target we - // use with decreasing priorities, VxWorks, does have - // contiguous OS priorities. - --current_priority; - } - } - } - - if (output_level () >= 3) - { - ACE_OS::printf ("thread %s, set priority to %d\n", - (const char*)rt_info.entry_point, - current_priority); - } - - rt_info.priority = current_priority; - - // There should only be one dependency for each - // RT_Info instance in the (sorted) thread_info_ array. - if (number_of_dependencies (rt_info) != 1) - { - ACE_ERROR ((LM_ERROR, - "On '%s' deps count should be 1, it is %d\n", - (const char*)rt_info.entry_point, - number_of_dependencies(rt_info))); - } - - // . . . and it should have a valid RT_Info pointer. - ACE_ASSERT (rt_info.dependencies[0].rt_info != -1); - RT_Info* tmp; - this->lookup_rt_info (rt_info.dependencies[0].rt_info, tmp); - tmp->priority = current_priority; - } - - - // Set the priority of every task. - ACE_Bounded_Set_Iterator <RT_Info *> root_i (*roots_); - RT_Info **root; - while (root_i.next (root) != 0) - { - root_i.advance (); - if (output_level () >= 4) - { - ACE_OS::printf ("ROOT: %s\n", - (const char*)(*root)->entry_point); - } - - RT_Info *leaf = 0; - leaf_info_->find ((const char*)(*root)->entry_point, leaf); - ACE_ASSERT (leaf != 0); - - if (output_level () >= 4) - { - ACE_OS::printf ("found leaf_info entry %s\n", - (const char*)leaf->entry_point); - } - - // Find the highest priority leaf corresponding to each root. - // ???? should do that! - - (*root)->priority = leaf->priority; - - // Update the priority of all dependent tasks. - // update_dependencies () is recursive, so set up the visited_ - // structure outside of it. - ACE_NEW_RETURN (visited_, - ACE_Bounded_Set <const RT_Info *> (tasks ()), - ST_VIRTUAL_MEMORY_EXHAUSTED); - - if (status () == NOT_SCHEDULED /* first mode */ || - status () == SUCCEEDED /* subsequent modes */ ) - { - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies (); call for " - "root %s to set priorities\n", - (const char*)(*root)->entry_point); - } - - status (update_dependencies (**root, 0 /* not used when - setting priorities */)); - } - - delete visited_; - visited_ = 0; - } - - // Set minimum_priority, the priority value of the lowest priority - // (highest numbered) dispatch queue. This is global, over all modes, - // so don't overwrite a smaller value. - if (increasing_priority_) - { - if (current_priority - minimum_priority > - (int) minimum_priority_queue ()) - { - if (output_level () >= 3) - { - ACE_OS::printf ("set minimum_priority_queue to %d = " - " %d - %d\n", - current_priority - minimum_priority, - current_priority, minimum_priority); - } - minimum_priority_queue (current_priority - minimum_priority); - } - } - else - { - if (minimum_priority - current_priority > - (int) minimum_priority_queue ()) - { - if (output_level () >= 3) - { - ACE_OS::printf ("set minimum_priority_queue to %d = " - " %d - %d\n", - current_priority - minimum_priority, - current_priority, minimum_priority); - } - minimum_priority_queue (minimum_priority - current_priority); - } - } - - // Load RT_Info pointers into ordered_info_ array for efficient lookup. - RT_Info ***entry; - ACE_Unbounded_Set_Iterator <RT_Info **> task_entries_i (task_entries_); - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - if ((*entry) [mode ()] != 0) - { - // This mode has a non-zero RT_Info pointer. - ordered_info_ [(*entry) [mode ()]->handle - 1][mode ()] = - (*entry) [mode ()]; - } - // else, just leave the ordered_info_ entry for this [task][mode] at 0. - } - - const u_int harmonically_related = - harmonically_related_periods (sorted_rt_info, - threads (), - frame_size_ [mode ()]); - - if (timeline_filename_ != 0) - { - status_t timeline_status; - if ((timeline_status = generate_timeline (sorted_rt_info, - threads (), - frame_size_ [mode ()], - timeline_ [mode()])) != - SUCCEEDED) - { - status (timeline_status); - } - } - - delete [] sorted_rt_info; - sorted_rt_info = 0; - - // Calculate the utilization bound, based on whether or not the - // task periods are harmonically related. - double utilization_bound; - - if (harmonically_related) - { - utilization_bound = 1.0; - } - else - { - utilization_bound = threads () * (::pow ((double) 2, 1./threads ()) - 1); - } - - // Don't overwrite status if an error had already been noted. - if (status () == NOT_SCHEDULED) - { - // Compare the total utilization to the utilization bound - // to determine whether or not the threads are schedulable. - status (utilization <= utilization_bound - ? SUCCEEDED - : ST_UTILIZATION_BOUND_EXCEEDED); - } - - // ???? if utilization bound is exceeeded, then should try all - // possible task phasings (RT test) - - if (output_level () >= 1) - { - ACE_OS::printf ("mode %u: utilization bound: %g; " - "total CPU utilization: %g: ", - mode (), - utilization_bound, - utilization); - Scheduler::output (stdout, status ()); - ACE_OS::printf ("\n\n"); - } - - return status (); -} - - -u_int -Scheduler_Internal::find_number_of_threads (mode_t mode) -{ - u_int number_of_threads = 0; - - // Quickly traverse RT_Info's to determine number of - // threads, so that the thread_ array can be allocated below. - RT_Info ***entry; - ACE_Unbounded_Set_Iterator <RT_Info **> task_entries_i (task_entries_); - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - RT_Info *rt_info = (*entry) [mode]; - - // This test misses thread delineators that are 0 in a particular - // mode. - if (rt_info != 0 && - (rt_info->threads > 0 || - (number_of_dependencies (rt_info) == 0 - && rt_info->period > 0))) - { - // This mode's RT_Info instance either has more than 0 - // "internal" threads, or delineates a thread because it - // has no dependencies and has a non-zero period. - int nt = rt_info->threads > 0 ? rt_info->threads : 1; - number_of_threads += nt; - if (output_level () >= 2) - { - ACE_OS::printf ("find_number_of_threads (): mode %u; entry %s; " - "added %u threads\n", - mode, - (const char*)rt_info->entry_point, - nt); - } - } - } - - if (output_level () >= 1) - { - ACE_OS::printf ("find_number_of_threads (): mode %u; " - "identified %lu threads\n", - mode, number_of_threads); - } - - return number_of_threads; -} - - -Scheduler::status_t -Scheduler_Internal::find_thread_delineators (mode_t mode) -{ - ACE_NEW_RETURN (dependencies_, - ACE_Bounded_Set <const RT_Info *> (tasks ()), - ST_VIRTUAL_MEMORY_EXHAUSTED); - - // Fill in the thread_ array. While doing this, load the - // dependencies set also. - RT_Info ***entry; - ACE_Unbounded_Set_Iterator <RT_Info **> task_entries_i (task_entries_); - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - RT_Info *rt_info = (*entry) [mode]; - - if (rt_info != 0) - { - if ((rt_info->threads > 0 || - (number_of_dependencies (rt_info) == 0 && - rt_info->period > 0))) - { - // This mode's RT_Info instance either has more than 0 - // "internal" threads, or delineates a thread because it - // has no dependencies and has a non-zero period. - - if (output_level () >= 5) - { - ACE_OS::printf ("find_thread_delineators (); %s is a leaf and" - " has %u threads\n", - (const char*)rt_info->entry_point, - rt_info->threads); - } - -#if 1 - // TODO: This seems to break several invariants on the - // RT_Info collection, I must talk to David about it. - - // Add one thread for non-active objects, and the number of - // threads otherwise. - for (u_int i = 0; - i < (rt_info->threads > 0 ? rt_info->threads : 1); - ++i) - { - RT_Info *thread_info; - // Set "name" of thread to be that of its root RT_Info. - ACE_NEW_RETURN (thread_info, RT_Info, - ST_VIRTUAL_MEMORY_EXHAUSTED); - thread_info->entry_point = rt_info->entry_point; - thread_info->threads = 0; - thread_info->period = 0; - Dependency_Info tmp; - tmp.number_of_calls = 0; - tmp.rt_info = rt_info->handle; - Scheduler::add_dependency (thread_info, tmp); - - if (output_level () >= 4) - { - ACE_OS::printf ("bind thread delineator %s\n", - (const char*)thread_info->entry_point); - } - - thread_info_ [mode].bind ((const char*)rt_info->entry_point, - thread_info); - } -#endif - } - - for (u_int dep = 0; - dep < number_of_dependencies (rt_info); - ++dep) - { - RT_Info* info; - this->lookup_rt_info (rt_info->dependencies[dep].rt_info, info); - if (output_level () >= 4) - { - ACE_OS::printf ("insert dependency %s\n", - (const char*)info->entry_point); - - } - if (dependencies_->insert (info) == -1) - { - return ST_VIRTUAL_MEMORY_EXHAUSTED; - } - } - - } - } - - return SUCCEEDED; -} - - -Scheduler::status_t -Scheduler_Internal::find_dependency_chain_roots (mode_t mode) -{ - ACE_NEW_RETURN (roots_, - ACE_Bounded_Set <RT_Info *> (tasks ()), - ST_VIRTUAL_MEMORY_EXHAUSTED); - - // Now do the fun traversal through all RT_Infos to look for roots of - // dependency trees. From each of those roots, traverse the dependency - // tree back to each leaf, which is one of the thread delineators that - // was found earlier. - RT_Info ***entry; - ACE_Unbounded_Set_Iterator <RT_Info **> task_entries_i (task_entries_); - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - RT_Info *rt_info = (*entry) [mode]; - - if (rt_info != 0 && dependencies_->find (rt_info) == -1) - { - if (output_level () >= 5) - { - ACE_OS::printf ("\"%s\" is not a dependent task (it is a " - "dependency-chain root); it has " - "%u dependencies\n", - (const char*)rt_info->entry_point, - number_of_dependencies (rt_info)); - } - - if (output_level () >= 4) - { - ACE_OS::printf ("insert root %s\n", - (const char*)rt_info->entry_point); - } - roots_->insert (rt_info); - } - } - - return SUCCEEDED; -} - - -Scheduler::status_t -Scheduler_Internal::find_dependency_chain_leaves () -{ - RT_Info **root; - ACE_Map_Manager <RT_Info *, Sub_Priority, ACE_Null_Mutex> - root_subpriorities; - - // Search through all of the dependency chain roots and assign - // subpriorities to them. In effect, this sorts the roots by - // importance. - - Sub_Priority current_subpriority = 0; - ACE_Bounded_Set_Iterator <RT_Info *> roots_i1 (*roots_); - while (roots_i1.next (root) != 0) - { - roots_i1.advance (); - RT_Info *rt_info = *root; - - if (rt_info == 0) continue; // The task does not run in this mode. - - // If we've seen the root already, ignore it. Otherwise, - // consider it a candidate as the lowest-importance root. - RT_Info **min_importance_root; - RtecScheduler::Importance root_importance; - if (root_subpriorities.find (*root) == -1) - { - if (output_level () >= 6) - { - ACE_OS::printf ("find_dependency_chain_leaves (); root \"%s\" " - "has not yet been visited\n", - rt_info ? (const char*)rt_info->entry_point : "NULL"); - } - min_importance_root = root; - root_importance = (*root)->importance; - } - else - { - if (output_level () >= 6) - { - ACE_OS::printf ("find_dependency_chain_leaves (); root \"%s\" " - "has already been visited\n", - rt_info ? (const char*)rt_info->entry_point : "NULL"); - } - min_importance_root = 0; - root_importance = (RtecScheduler::Importance) 0xFFFFFFFF; - } - - RT_Info **root2; - ACE_Bounded_Set_Iterator <RT_Info *> roots_i2 (*roots_); - while (roots_i2.next (root2) != 0) - { - roots_i2.advance (); - if (root2 == root || *root2 == 0) continue; - - RtecScheduler::Importance root2_importance = (*root2)->importance; - - if ((min_importance_root == 0 || - root2_importance < root_importance) && - root_subpriorities.find (*root2) == -1) - { - min_importance_root = root2; - root_importance = root2_importance; - } - } - - // At this point, min_importance_root contains the root with - // the lowest importance, among all those that we haven't visited yet. - if (output_level () >= 6) - { - ACE_OS::printf ("lowest importance root is \"%s\"\n", - (const char*)(*min_importance_root)->entry_point); - } - - int result; - if ((result = root_subpriorities.bind (*min_importance_root, - current_subpriority++)) != 0) - { - ACE_OS::fprintf (stderr, - "Scheduler_Internal::find_dependency_chain_leaves ();" - "bind of %s to %d failed with result %d!!!!\n", - (const char*)(*min_importance_root)->entry_point, - current_subpriority, - result); - return ST_VIRTUAL_MEMORY_EXHAUSTED; - } - else - { - if (output_level () >= 6) - { - ACE_OS::fprintf (stderr, - "Scheduler_Internal::find_dependency_chain_leaves ();" - "bind of \"%s\" to %d succeeded.\n", - (const char*)(*min_importance_root)->entry_point, - current_subpriority); - } - - Sub_Priority subp; - root_subpriorities.find (*min_importance_root, subp); - (*min_importance_root)->subpriority = subp; - if (output_level () >= 4) - { - ACE_OS::printf ("\"%s\" assigned subpriority %d\n\n", - (const char*)(*min_importance_root)->entry_point, - subp); - } - } - } - - size_t roots = root_subpriorities.current_size (); - if (output_level () >= 4) - { - ACE_OS::printf ("%u roots\n", roots); - } - - // Sort the roots by importance, least first. - u_int i; - RT_Info **sorted_root; - ACE_NEW_RETURN (sorted_root, RT_Info *[roots], ST_VIRTUAL_MEMORY_EXHAUSTED); - - RT_Info **visited_root; - ACE_NEW_RETURN (visited_root, - RT_Info *[roots], - ST_VIRTUAL_MEMORY_EXHAUSTED); - u_int next_visited_root = 0; - for (i = 0; i < roots; ++i) - { - visited_root[i] = 0; - } - - Sub_Priority min_subp; - RT_Info *min_subp_root = 0; - for (i = 0; i < roots; ++i) - { - min_subp = 0x7FFF; - - ACE_Bounded_Set_Iterator <RT_Info *> roots_i3 (*roots_); - while (roots_i3.next (root) != 0) - { - roots_i3.advance (); - RT_Info *rt_info = *root; - - if (output_level () >= 6) - { - ACE_OS::printf ("find_dependency_chain_leaves (); " - "sorted root \"%s\"\n", - rt_info ? (const char*)rt_info->entry_point : "NULL"); - } - - if (rt_info == 0) continue; // The task does not run in this mode. - u_int next_root = 0; - for (u_int j = 0; j < roots; ++j) - { - if (visited_root[j] == rt_info) next_root = 1; - } - if (next_root == 1) continue; - - if (min_subp > rt_info->subpriority) - { - min_subp = rt_info->subpriority; - min_subp_root = rt_info; - } - } - - sorted_root[i] = min_subp_root; - visited_root[next_visited_root++] = min_subp_root; - } - - delete [] visited_root; - - // Now do the fun traversal from each root of a dependency chain. - // From each of those roots, traverse the dependency chain back to - // each leaf, which is one of the thread delineators that was found earlier. - for (i = 0; i < roots; ++i) - { - if (sorted_root[i] == 0) break; - - RT_Info *rt_info = sorted_root[i]; - - if (rt_info == 0) continue; // The task does not run in this mode. - - // Update the subpriority of this task: set it to the minimum - // subpriority if it hadn't already been set. - if (rt_info->subpriority < 0) - { - if (output_level () >= 4) - { - ACE_OS::printf ("find_dependency_chain_leaves (); " - "set subpriority of %s to %u\n", - (const char*)rt_info->entry_point, - ACE_Scheduler_MIN_SUB_PRIORITY); - } - rt_info->subpriority = ACE_Scheduler_MIN_SUB_PRIORITY; - } - - // Update the subpriority of all dependent tasks. - // update_dependencies () is recursive, so set up the visited_ - // structure outside of it. - ACE_NEW_RETURN (visited_, - ACE_Bounded_Set <const RT_Info *> (tasks ()), - ST_VIRTUAL_MEMORY_EXHAUSTED); - - if (status () == NOT_SCHEDULED /* first mode */ || - status () == SUCCEEDED /* subsequent modes */ ) - { - Sub_Priority subp; - root_subpriorities.find (rt_info, subp); - - if (output_level () >= 4) - { - ACE_OS::printf ("update_dependencies (); call for " - "root %s to set subpriorities, starting with " - "%d\n", - (const char*)rt_info->entry_point, - subp); - } - - status (update_dependencies (*rt_info, subp)); - } - - delete visited_; - visited_ = 0; - } - - delete [] sorted_root; - - return SUCCEEDED; -} - - -Scheduler::status_t -Scheduler_Internal::identify_threads () -{ - status_t temp_status; - - reset (); - - // Figure out how many threads there are in this mode. - threads (find_number_of_threads (mode ())); - - // Find and store the thread delineators: they have no dependencies - // and have a specified rate, or they have internal threads of their own. - if ((temp_status = find_thread_delineators (mode ())) != SUCCEEDED) - { - return temp_status; - } - - // Find and store dependency-chain roots. - if ((temp_status = find_dependency_chain_roots (mode ())) != SUCCEEDED) - { - return temp_status; - } - - // Find and store dependency-chain leaves. - if ((temp_status = find_dependency_chain_leaves ()) != SUCCEEDED) - { - return temp_status; - } - - return SUCCEEDED; -} - - -Scheduler::status_t -Scheduler_Internal::aggregate_thread_parameters () -{ - ACE_NEW_RETURN (leaf_info_, Thread_Map (), - ST_VIRTUAL_MEMORY_EXHAUSTED); - - ACE_Bounded_Set_Iterator <RT_Info *> roots_i (*roots_); - RT_Info **root; - while (roots_i.next (root)) - { - roots_i.advance (); - if (*root != 0) - { - RT_Info &rt_info = **root; - - if (output_level () >= 4) - { - ACE_OS::printf ("root: %s\n", (const char*)rt_info.entry_point); - } - - RT_Info leaf_info (rt_info); - RT_Info *leaf = &rt_info; - - for (u_int i = 0; i < number_of_dependencies (rt_info); ++i) - { - RT_Info* info; - this->lookup_rt_info(rt_info.dependencies[i].rt_info, info); - leaf = - &calculate_thread_properties (leaf_info, - *info, - rt_info.dependencies[i]. - number_of_calls); - if (output_level () >= 4) - { - ACE_OS::printf ("reached leaf %s\n", - (const char*)leaf->entry_point); - } - } - - if (output_level () >= 4) - { - ACE_OS::printf ("root %s maps to leaf %s\n", - (const char*)rt_info.entry_point, - (const char*)leaf->entry_point); - } - leaf_info_->bind ((const char*)rt_info.entry_point, leaf); - - RT_Info *thread_info = 0; - thread_info_ [mode ()].find ((const char*)leaf->entry_point, - thread_info); - if (thread_info == 0) - { - ACE_ERROR ((LM_ERROR, - "Task \"%s\" depends on a thread identified " - "by \"%s\", which does not \n" - "have a period or internal threads. " - "Is that dependency backwards?\n", - (const char*)rt_info.entry_point, - (const char*)leaf->entry_point)); - } - ACE_ASSERT (thread_info != 0); - - if (output_level () >= 4) - { - ACE_OS::printf ("found thread_info entry %s\n", - (const char*)thread_info->entry_point); - } - - // Add the dependency chain's aggregate parameters to that - // of the thread. - (void) operator+= (thread_info, leaf_info); - } - } - - return SUCCEEDED; -} - - -RtecScheduler::RT_Info & -Scheduler_Internal::calculate_thread_properties (RT_Info &thread_info, - RT_Info &rt_info, - const u_int number_of_calls) -{ - u_int i; - - for (i = 0; i < number_of_calls; ++i) - { - (void) operator+= (&thread_info, rt_info); - } - - if (output_level () >= 4) - { - ACE_OS::printf ("calculate_thread_properties (); " - "time: %ld, period: %ld usec\n", -#if defined (ACE_WIN32) || defined (ACE_HAS_LONGLONG_T) - thread_info.worst_case_execution_time, -#else - thread_info.time.lo (), -#endif /* ACE_WIN32 || ACE_HAS_LONGLONG_T */ - thread_info.period / 10 /* usec/100 ns */); - } - - if (number_of_dependencies (rt_info) == 0) - { - if (output_level () >= 4) - { - ACE_OS::printf ("calculate_thread_properties (); " - "reached leaf %s\n", - (const char*)rt_info.entry_point); - } - return rt_info; - } - -#if 0 - for (i = 0; i < number_of_dependencies (rt_info); ++i ) - { - // TODO: - if (rt_info.dependencies[i].rt_info.value() != 0) - { - RT_Info info; - rt_info.dependencies[i].rt_info >>= &info; - if (output_level () >= 4) - { - ACE_OS::printf ("calculate_thread_properties (): recurse on " - "dependency %s\n", - (const char*)info.entry_point); - } - - RT_Info& ret = - calculate_thread_properties (thread_info, - info, - rt_info.dependencies[i]. - number_of_calls); - return ret; - } - } -#endif /* 0 */ - - ACE_ASSERT (! "should never reach this!"); // should never get here! - return rt_info; // to avoid compilation warning -} - - -int -Scheduler_Internal::priority (const handle_t handle, - OS_Thread_Priority &priority, - Sub_Priority &subpriority, - Preemption_Priority &preemption_prio, - const mode_t requested_mode) const -{ - // Casting away the const. - ACE_Guard<LOCK> ace_mon (((Scheduler_Internal *) this)->lock_); - - const mode_t lookup_mode = requested_mode == CURRENT_MODE - ? mode () - : requested_mode; - - if (!ordered_info_) - { - priority = minimum_priority_; - subpriority = ACE_Scheduler_MIN_SUB_PRIORITY; - preemption_prio = ACE_Scheduler_MAX_PREEMPTION_PRIORITY; - return 0; - } - else if (lookup_mode < modes () && handle <= handles_ && - ordered_info_ [handle - 1][lookup_mode] != 0) - { - priority = ordered_info_ [handle - 1][lookup_mode]->priority; - subpriority = ordered_info_ [handle - 1][lookup_mode]->subpriority; - - if (increasing_priority_) - { -#if defined (ACE_WIN32) - // Find the queue_number by iterating over the OS thread priorities. - // This allows proper handling of non-contiguous OS priorities. - // It would be more efficient to store the queue number in the - // RT_Info instead of computing it here every time. This is only - // intended for off-line scheduling, though, so it's not critical. - // TODO: // ???? Hard-code knowledge of 5 dispatch queues!! - preemption_prio = 4; - for (ACE_Sched_Priority p = - ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, - ACE_SCOPE_PROCESS); - priority > p; - p = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, - p, - ACE_SCOPE_PROCESS)) - { - --preemption_prio; - } -#else /* ! ACE_WIN32 */ - // E.g., Solaris, which has contiguous priorities. - preemption_prio = minimum_priority_queue () - - (priority - minimum_priority_); -#endif /* ! ACE_WIN32 */ - } - else - { - // Assume VxWorks, which has contiguous priorities. - preemption_prio = minimum_priority_queue () - - (minimum_priority_ - priority); - } - - // TODO: This should be updated when priority and subpriority - // are set, but I don't know when that happens :( - ordered_info_ [handle - 1][lookup_mode]->preemption_priority = - preemption_prio; - - if (output_level () >= 3) - { - ACE_OS::printf ("preemption_prio %d: min %d, pri %d, min_pri %d\n", - preemption_prio, minimum_priority_queue (), - priority, minimum_priority_); - } - - return 0; - } else { - return -1; - } -} - - -void -Scheduler_Internal::print_schedule () -{ - for (mode_t m = 0; m < modes (); ++m) - { - ACE_OS::printf ("\nMode %u:\n", m); - ACE_OS::printf ("Task Priority Subpri- CPU Time Period Rate " - "Utilization Name\n" - " ority microsec microsec Hz\n" - "---- -------- ------- -------- -------- ---- " - "----------- ----\n"); - - // at 1 and incrementing by 1. - for (u_int task = 1; task <= tasks (); ++task) - { - RtecScheduler::OS_Priority prio; - RtecScheduler::Sub_Priority subpriority; - RtecScheduler::Preemption_Priority preemption_prio; - if (priority (task, - prio, - subpriority, - preemption_prio, - m) == -1) - { - ACE_OS::printf ("%3u -- -- -- " - " -- -- -- %s\n", - task, - (const char*)ordered_info_[task-1][m]->entry_point); - } - else - { -#if defined (ACE_WIN32) || defined (ACE_HAS_LONGLONG_T) - const u_long t = - (u_long) ordered_info_ [task-1][m]->worst_case_execution_time / - 10 /* microsec/100 ns */; -#else - const u_long t = ordered_info_ [task-1][m]->time.lo () / - 10 /* microsec/100 ns */; -#endif /* ACE_WIN32 || ACE_HAS_LONGLONG_T */ - - ACE_OS::printf ("%3u %6d %6d %8lu" - "%9lu%5lu %6.4f %s\n", - task, prio, subpriority, t, - (u_long) (ordered_info_ [task-1][m]->period / - 10 /* microsec/100 ns */), - ordered_info_ [task-1][m]->period > 0 - ? (u_long) (1.0e7 / - ordered_info_ [task-1][m]-> - period) - : 0L, - ordered_info_ [task-1][m]->period > 0 - ? (double) t / - ordered_info_ [task-1][m]->period - : 0.0, - (const char*)ordered_info_[task-1][m]->entry_point); - } - } - } -} - - -Scheduler::status_t -Scheduler_Internal::store_schedule (const char *filename) -{ - u_int i; - FILE *const file = ACE_OS::fopen (filename, "w"); - - if (file) - { - ACE_OS::fprintf (file, "\ -// Automatically generated \"%s\"\n\ -\n\ -#include \"Scheduler_Runtime.h\"\n\ -\n\ -static const unsigned int MODES = %u;\n\ -static const unsigned int TASKS = %u;\n\ -static const unsigned int THREADS = %u;\n\ -static const unsigned int MINIMUM_PRIORITY_QUEUE = %u;\n\ -\n\ -int\n\ -Scheduler_Runtime_registered_tasks_ [TASKS] = { 0 };\n\ -\n\ -const char *\n\ -Scheduler_Runtime_task_names_ [TASKS] =\n\ - {\n\ -", filename, - modes (), - tasks (), - threads (), - minimum_priority_queue ()); - - for (i = 0; i < tasks (); ++i) - { - ACE_OS::fprintf (file, " \"%s\"%s\n", - (const char*)ordered_info_ [i][0]->entry_point, - i == tasks () - 1 ? "" : ","); - } - - ACE_OS::fprintf (file, "\ - };\n\ -\n\ -int\n\ -Scheduler_Runtime_priorities_ [MODES][TASKS][3] =\n\ - {\n\ -"); - - for (i = 0; i < modes (); ++i) - { - ACE_OS::fprintf (file, " { /* mode %u */\n", i); - for (u_int j = 0; j < tasks (); ++j) - { - RtecScheduler::OS_Priority priority; - RtecScheduler::Sub_Priority subpriority; - RtecScheduler::Preemption_Priority preemption_prio; - if (ordered_info_ [j][i] == 0) - { - // This task doesn't run in this mode. - priority = increasing_priority_ ? minimum_priority_ - 1 - : minimum_priority_ + 1; - subpriority = -1; - preemption_prio = minimum_priority_queue () + 1; - } - else - { - this->priority (j+1, priority, subpriority, preemption_prio, i); - } - - ACE_OS::fprintf (file, " { %d, %d, %u }%s\n", - priority, - subpriority, - preemption_prio, - j == tasks () - 1 ? "" : ","); - } - ACE_OS::fprintf (file, " }%s /* end mode %u */\n", - i == modes () - 1 ? "" : ",", i); - } - - ACE_OS::fprintf (file, "\ - };\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::modes ()\n\ -{\n\ - return MODES;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::tasks ()\n\ -{\n\ - return TASKS;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::threads ()\n\ -{\n\ - return THREADS;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::minimum_priority_queue ()\n\ -{\n\ - return MINIMUM_PRIORITY_QUEUE;\n\ -}\n\ -\n\ -const char *\n\ -Scheduler_Runtime::task_name (const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_task_names_ [handle - 1];\n\ -}\n\ -\n\ -int\n\ -Scheduler_Runtime::priority (const unsigned int mode,\n\ - const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_priorities_ [mode][handle - 1][0];\n\ -}\n\ -\n\ -int\n\ -Scheduler_Runtime::subpriority (const unsigned int mode,\n\ - const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_priorities_ [mode][handle - 1][1];\n\ -}\n\ -\n\ -int\n\ -Scheduler_Runtime::preemption_prio (const unsigned int mode,\n\ - const unsigned int handle)\n\ -{\n\ - return Scheduler_Runtime_priorities_ [mode][handle - 1][2];\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::config ()\n\ -{\n\ - return 0;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::find (const char *operation_name)\n\ -{\n\ - for (unsigned int i = 0; i < TASKS; ++i)\n\ - if (! ACE_OS::strcmp (operation_name,\n\ - Scheduler_Runtime_task_names_ [i]))\n\ - return i + 1;\n\ -\n\ - return 0;\n\ -}\n\ -\n\ -unsigned int\n\ -Scheduler_Runtime::register_task (const unsigned int task)\n\ -{\n\ - if (Scheduler_Runtime_registered_tasks_ [task - 1] == 1)\n\ - {\n\ - return 0;\n\ - }\n\ - else\n\ - {\n\ - Scheduler_Runtime_registered_tasks_ [task - 1] = 1;\n\ - return task;\n\ - }\n\ -}\n\ -\n\ -"); - - if (ACE_OS::fprintf (file, "// EOF\n") > 0 && - ACE_OS::fclose (file) == 0) - { - return SUCCEEDED; - } - else - { - return UNABLE_TO_WRITE_SCHEDULE_FILE; - } - } - else - { - return UNABLE_TO_OPEN_SCHEDULE_FILE; - } -} - - -Scheduler::status_t -Scheduler_Internal::store_rt_info (const char *filename) -{ - FILE *file = ACE_OS::fopen (filename, "w"); - if (file) - { - const time_t now = ACE_OS::time (0); - - (void) ACE_OS::fprintf (file, - "# RT_Info provided for \"%s\" %s" - "# Version 1.1\n" - "# Format for each entry:\n" - "# entry name\n" - "# handle\n" - "# worst case execution time\n" - "# typical execution time\n" - "# cached execution time\n" - "# period\n" - "# importance\n" - "# quantum\n" - "# begin dependencies\n" - "# number of dependencies\n" - "# entry name, number of calls " - "(one of these lines per dependency, if any)\n" - "# end dependencies\n" - "# priority\n" - "# order within priority\n\n" - "%u modes\n%u operations\n\n", - filename, ACE_OS::ctime (&now), - modes (), tasks ()); - - RT_Info ***entry; - ACE_Unbounded_Set_Iterator <RT_Info **> - task_entries_i (task_entries_); - while (task_entries_i.next (entry) != 0) - { - task_entries_i.advance (); - export( (*entry) [0], file); - } - } - else - { - return UNABLE_TO_OPEN_SCHEDULE_FILE; - } - - if (ACE_OS::fprintf (file, "\n# end of file\n", 1) > 0 && - ACE_OS::fclose (file) == 0) - { - return SUCCEEDED; - } - else - { - return UNABLE_TO_WRITE_SCHEDULE_FILE; - } -} - - -// This implementation is incredibly ugly, but it sometimes works. The -// timeline viewer accepts start/stop pairs by task, and figures out the -// preemption. So, it's not necessary to figure out the preemptions. -Scheduler::status_t -Scheduler_Internal::generate_timeline ( - Mode_Entry const sorted_rt_info [], - const u_int number_of_tasks, - u_long frame_size, - ACE_Unbounded_Queue <Timeline_Entry> &jobs) -{ - if (number_of_tasks > 0) - { - u_long start = 0; - u_long stop = 0; - u_int i; - u_long *next_start; - u_long *leftover; - - ACE_NEW_RETURN (next_start, u_long [number_of_tasks], - ST_VIRTUAL_MEMORY_EXHAUSTED); - ACE_NEW_RETURN (leftover, u_long [number_of_tasks], - ST_VIRTUAL_MEMORY_EXHAUSTED); - - for (i = 0; i < number_of_tasks; ++i) - { - next_start [i] = 0; - leftover [i] = 0; - } - - while (stop <= frame_size) - { - for (i = number_of_tasks; i > 0; --i) - { - u_long execution_time = 0; // microseconds - - if (start < next_start [i - 1]) - { - if (leftover [i - 1] == 0) - { - // Not at this task's next start period, and it - // has no leftover work in it's current period, - // so move on to the next task. - - if (output_level () >= 3) - { - ACE_OS::printf (" continue for task %lu\n", - sorted_rt_info [i - 1].rt_info_->handle); - } - - continue; - } - else - { - if (output_level () >= 3) - { - ACE_OS::printf (" leftover for task %lu\n", - sorted_rt_info [i - 1].rt_info_->handle); - } - - execution_time = leftover [i - 1]; - leftover [i - 1] = 0; - } - } - else - { - if (output_level () >= 3) - { - ACE_OS::printf (" task %s reached next start of" - " %lu (at %lu)\n", - (const char*)sorted_rt_info [i - 1].rt_info_-> - entry_point, - next_start [i - 1], - start); - } - - execution_time = (u_long) - (sorted_rt_info [i - 1].rt_info_->worst_case_execution_time / - 10 /* us/100 ns */); - - next_start [i - 1] += - (u_long) (sorted_rt_info [i - 1].rt_info_->period / - 10 /* usec/100 ns */); - - if (output_level () >= 3) - { - ACE_OS::printf (" loaded next_start of %lu with " - "%lu\n", - sorted_rt_info [i - 1].rt_info_-> - handle, - next_start [i - 1]); - } - } - - if (output_level () >= 3) - { - ACE_OS::printf (" handle: %d, " - " execution_time: %lu, " - " leftover: %lu\n", - sorted_rt_info [i - 1].rt_info_->handle, - execution_time, - leftover [i - 1]); - } - - // Look for a start time of a higher priority task that - // is before this one can finish. - int will_finish = 1; - for (u_int j = number_of_tasks; j > i; --j) - { - // Skip over groups of array entries with the same period. - if (j < number_of_tasks && - sorted_rt_info [j - 1].rt_info_->period == - sorted_rt_info [j].rt_info_->period) - { - break; - } - - if (next_start [j - 1] > 0 && - next_start [j - 1] <= start + execution_time) - { - leftover [i - 1] = execution_time - - (next_start [j - 1] - start); - execution_time = next_start [j - 1] - start; - will_finish = 0; - if (output_level () >= 3) - { - ACE_OS::printf (" handle: %d, " - " execution_time: %lu, " - " leftover: %lu\n", - sorted_rt_info [i - 1].rt_info_-> - handle, - execution_time, - leftover [i - 1]); - } - } - - if (output_level () >= 2) - { - ACE_OS::printf (" period: %ld, time: %lu usec, " - " period ratio: %lu, " - " execution_time: %lu usec\n", - sorted_rt_info [j-1].rt_info_-> - period / 10 /* usec/100 ns */, - (u_long) (sorted_rt_info [j-1].rt_info_-> - worst_case_execution_time / 10 /* usec/100 ns */), - sorted_rt_info [j-1].rt_info_->period - > 0 - ? (u_long) (sorted_rt_info [i-1]. - rt_info_->period / - sorted_rt_info [j-1]. - rt_info_->period) - : 0, - execution_time / 10 /* usec/100 ns */); - } - } - - if (output_level () >= 3) - { - ACE_OS::printf (" period: %ld usec, time: %lu usec, " - " execution_time: %lu usec\n", - sorted_rt_info [i - 1].rt_info_-> - period / 10 /* usec/100 ns */, - (u_long) (sorted_rt_info [i - 1].rt_info_-> - worst_case_execution_time / 10 /* usec/100 ns */), - execution_time / 10 /* usec/100 ns */); - } - - jobs.enqueue_head (Timeline_Entry (sorted_rt_info [i - 1].rt_info_-> - handle, - sorted_rt_info [i - 1].rt_info_-> - entry_point, - start, - stop = start + execution_time, - next_start [i - 1])); - start = stop; - - if (! will_finish) - { - // don't bother to visit any other tasks: restart - // with the highest priority task - break; - } - } - - // figure out next start time based on periods only - u_long min_start = 0xFFFFFFFF; - for (i = 0; i < number_of_tasks; ++i) - { - if (min_start > next_start [i]) min_start = next_start [i]; - } - start = min_start; - - // if any tasks haven't finished the current period processing, - // let them try to finish by overwriting "start" with "stop" - for (i = 0; i < number_of_tasks; ++i) - { - if (leftover [i] > 0) - { - start = stop; - break; - } - } - } - - delete [] next_start; - next_start = 0; - delete [] leftover; - leftover = 0; - } - - return SUCCEEDED; -} - - -Scheduler::status_t -Scheduler_Internal::create_timelines (const char *filename) -{ - // Store each mode's timeline in a different file. Append the - // mode identifier to filename. - char full_filename [MAXPATHLEN]; - ACE_OS::strcpy (full_filename, filename); - char *filename_extension = full_filename + ACE_OS::strlen (filename); - if (filename_extension == 0) - { - return UNABLE_TO_OPEN_SCHEDULE_FILE; - } - - status_t status = SUCCEEDED; - - for (u_int mode = 0; - (status == SUCCEEDED || status == ST_UTILIZATION_BOUND_EXCEEDED) && - mode < modes (); - ++mode) - { - char mode_id[128]; - ACE_OS::sprintf (mode_id, "-mode_%d.timeline", mode + 1); - ACE_OS::strcpy (filename_extension, mode_id); - - FILE *const file = ACE_OS::fopen (full_filename, "w"); - if (file) - { - u_int i; - - // count the number of tasks in this mode with non-null RT_Info - u_int nonnull_tasks = 0; - for (i = 0; i < tasks (); ++i) - { - if (ordered_info_ [i][mode] != 0) - { - ++nonnull_tasks; - } - } - ACE_OS::fprintf (file, "%u\n", nonnull_tasks); /* number_of_tasks */ - - - ACE_OS::fprintf (file, "%lu\n", /* frame_size */ - frame_size_ [mode]); - ACE_OS::fprintf (file, "0 %lu\n", /* start stop_times */ - frame_size_ [mode]); - - ACE_Bounded_Set <u_int> emitted_tasks (nonnull_tasks); - u_int max_priority = 0x7FFFFFFF; - for (i = 0; i < tasks (); ++i) - { - u_int highest_priority = 0x7FFFFFFF; /* corresponds to lowest - queue number */ - u_int highest_priority_task = 0xFFFFFFFF; - - for (u_int j = 0; j < tasks (); ++j) - { - if (ordered_info_ [j][mode] != 0) - { - RtecScheduler::OS_Priority priority; - RtecScheduler::Sub_Priority subpriority; - RtecScheduler::Preemption_Priority preemption_prio; - this->priority (j+1, priority, subpriority, preemption_prio, - mode); - - if (i == 0) - { - if (max_priority > preemption_prio) - { - max_priority = preemption_prio; - } - } - - if (! emitted_tasks.find (j) && - highest_priority > preemption_prio) - { - highest_priority = preemption_prio; - highest_priority_task = j; - } - } - } - - /* task_name priority */ - if (highest_priority_task < 0xFFFFFFFF) - { - ACE_OS::fprintf (file, "%s %d\n", - /* task name */ - (const char*)ordered_info_ [highest_priority_task][mode]-> - entry_point, - /* queue number */ - minimum_priority_queue () - - (increasing_priority_ - ? ordered_info_ [highest_priority_task][mode]-> - priority - - minimum_priority_ - : minimum_priority_ - - ordered_info_ [highest_priority_task][mode]-> - priority)); - - emitted_tasks.insert (highest_priority_task); - } - } - - const u_int timeline_entries = (u_int) timeline_ [mode].size (); - for (i = 0; i < timeline_entries; ++i) - { - Timeline_Entry entry; - if (! timeline_ [mode].dequeue_head (entry)) - { - ACE_OS::fprintf (file, "%s %d %s\n%s %d %d\n", - entry.entry_point_, - entry.start_, - "", /* label */ - entry.entry_point_, - entry.stop_, - entry.next_start_); - } - } - - if (ACE_OS::fclose (file) != 0) - { - status = UNABLE_TO_WRITE_SCHEDULE_FILE; - } - } - else - { - status = UNABLE_TO_OPEN_SCHEDULE_FILE; - } - } - - return status; -} - - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Bounded_Set<RtecScheduler::RT_Info *>; -template class ACE_Bounded_Set<const RtecScheduler::RT_Info *>; -template class ACE_Bounded_Set<u_int>; -template class ACE_Bounded_Set_Iterator<RtecScheduler::RT_Info *>; -template class ACE_Node<Scheduler_Internal::Timeline_Entry>; -template class ACE_Node<RtecScheduler::RT_Info **>; -template class ACE_Unbounded_Queue<Scheduler_Internal::Timeline_Entry>; -template class ACE_Unbounded_Queue_Iterator< - Scheduler_Internal::Timeline_Entry>; -template class ACE_Unbounded_Set<RtecScheduler::RT_Info **>; -template class ACE_Unbounded_Set_Iterator<RtecScheduler::RT_Info **>; - -template class ACE_Map_Entry <RtecScheduler::RT_Info *, Scheduler::Sub_Priority>; -template class ACE_Map_Manager <RtecScheduler::RT_Info *, Scheduler::Sub_Priority, - ACE_Null_Mutex>; - -#if defined (ACE_HAS_THREADS) - template class ACE_Map_Entry<ACE_CString, RtecScheduler::RT_Info *>; - template class ACE_Map_Manager<ACE_CString, RtecScheduler::RT_Info *, ACE_Null_Mutex>; - template class ACE_Map_Iterator<ACE_CString, RtecScheduler::RT_Info *, ACE_Null_Mutex>; -#endif /* ACE_HAS_THREADS */ -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - -// EOF diff --git a/TAO/local/bin/Scheduling_Service/Scheduler_Internal.h b/TAO/local/bin/Scheduling_Service/Scheduler_Internal.h deleted file mode 100644 index 45bd2060110..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler_Internal.h +++ /dev/null @@ -1,252 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler_Internal.h -// -// = CREATION DATE -// 23 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - -#if ! defined (SCHEDULER_INTERNAL_H) -#define SCHEDULER_INTERNAL_H - -#include "ace/Containers.h" -#include "ace/ACE.h" - -#include "Scheduler.h" - -struct Mode_Entry; // for internal use only - -class Scheduler_Internal : public ACE_Scheduler - // = TITLE - // Implementation of an off-line scheduler. - // - // = DESCRIPTION - // Schedules tasks using rate-monotonic scheduling. -{ -public: - Scheduler_Internal (); - virtual ~Scheduler_Internal (); - - // = Initialize the scheduler. - virtual void init (const int minimum_priority, - const int maximum_priority, - const char *runtime_filename = 0, - const char *rt_info_filename = 0, - const char *timeline_filename = 0); - - // = Registers a task. - virtual status_t register_task (RT_Info *[], - const u_int number_of_modes, - handle_t &handle); - - virtual status_t lookup_rt_info (handle_t handle, - RT_Info* &rtinfo); - // Obtains an RT_Info based on its "handle". - - // = Computes the schedule. - virtual status_t schedule (void); - - // = Access a thread priority. - virtual int priority (const handle_t handle, - OS_Thread_Priority &priority, - Sub_Priority &subpriority, - Preemption_Priority &preemption_prio, - const mode_t = CURRENT_MODE) const; - // Defines "priority" as the priority that was assigned to the Task that - // was assigned "handle", for the specified mode. Defines "subpriority" - // as the relative ordering (due to dependencies) within the priority. - // Returns 0 on success, or 1 if an invalid mode or handle are supplied. - - typedef ACE_Map_Entry <ACE_CString, RT_Info *> Thread_Map_Entry; - typedef ACE_Map_Manager <ACE_CString, RT_Info *, ACE_Null_Mutex> - Thread_Map; - typedef ACE_Map_Iterator <ACE_CString, RT_Info *, ACE_Null_Mutex> - Thread_Map_Iterator; - -private: - u_int handles_; - // The number of task handles dispensed so far. - - int minimum_priority_; - // The minimum priority value that the application specified (in - // its call to init ()). - - int maximum_priority_; - // The maximum priority value that the application specified (in - // its call to init ()). - - const char *runtime_filename_; - // Destination file of Scheduler output from the configuration run. - - const char *rt_info_filename_; - // Destination file of all rt_info data from the configuration run. - - const char *timeline_filename_; - // The destination of the timeline. - - int increasing_priority_; - // Set to 1 if priority values increase with increasing priority, - // such as on Solaris and Win32, or 0 if they decrease, such as on - // VxWorks. - - ACE_Unbounded_Set <RT_Info **> task_entries_; - // Collection of known tasks. - - RT_Info ***ordered_info_; - // An ordered array of pointers to the RT_Info pointers stored - // in task_entries_. It is index by [handle][mode]. This permits - // efficient retrieval by get_priority (). - - ACE_Bounded_Set <const RT_Info *> *visited_; - // When updating dependencies, use this set to keep track of - // visited RT_Info instances in order to detect cycles in the - // dependency graph. It is dynamically allocated/deallocated so that - // it doesn't have to be "cleaned out" manually for each mode. - - ACE_Bounded_Set <RT_Info *> *leaves_; - // For 1) storing aggregate thread execution parameters during - // traversal of dependency chains, and - // 2) assigning priorities to all tasks. - - ACE_Bounded_Set <const RT_Info *> *dependencies_; - // Collection of RT_Info's that are dependent tasks, for efficient - // identification of dependency-chain roots. - - ACE_Bounded_Set <RT_Info *> *roots_; - // Collection of RT_Info's that are roots of dependency chains. - - status_t update_dependencies (RT_Info &, Sub_Priority subpriority); - // For each of this task's dependencies (transitively), increment its - // subpriority. The higher subpriorities indicate that the dependent - // tasks should run before this task. - - u_long *frame_size_; /* millisec */ - // For creating timelines (array indexed by mode). - - Thread_Map *thread_info_; - // Collection of known threads, dynamically allocated because - // it is reused for each mode. It consists of a amp of RT_Info - // instances, keyed by entry_point, that aggregate the info for the - // entire thread. Each instance has one dependency: the root - // RT_Info instance of the thread. - // *thread_info_ is an array, indexed by mode. - - Thread_Map *leaf_info_; - // Mapping from roots of dependency chains to their leaves. - -public: // for template specialization - struct Timeline_Entry - { - u_long handle_; - const char *entry_point_; - u_long start_; // microseconds - u_long stop_; // microseconds - u_long next_start_; - - Timeline_Entry (const u_long handle = 0, - const char *entry_point = 0, - const u_long start = 0, - const u_long stop = 0, - const u_long next_start = 0) - : handle_ (handle), - entry_point_ (entry_point), - start_ (start), - stop_ (stop), - next_start_ (next_start) {} - }; -private: -#if defined (ACE_HAS_THREADS) - typedef ACE_Recursive_Thread_Mutex LOCK; -#else - typedef ACE_Null_Mutex LOCK; -#endif /* ACE_HAS_THREADS */ - - LOCK lock_; - // This protects access to the scheduler during configuration runs. - - ACE_Unbounded_Queue <Timeline_Entry> *timeline_; - // For storing timelines. - - - /////////////////////////////////////// - // member functions for internal use // - /////////////////////////////////////// - - void reset (); - // Prepare for another schedule computation, but do not - // disturb the "output" (priorities that have already been assigned). - - status_t schedule_rms (const int minimum_priority, - const int maximum_priority); - // Computes the schedule using Rate Monotonic Scheduling. - - RT_Info &calculate_thread_properties (RT_Info &thread_info, - RT_Info &rt_info, - const u_int number_of_calls); - // Computes the execution time, etc., of the thread, identified by - // rt_info, and store it in thread_info, by recursively traversing - // the RT_Info call chain. Returns the root node. - - void print_schedule (); - // Display the schedule, task-by-task. - - status_t store_schedule (const char *filename); - // Store the schedule in the named file. - - status_t store_rt_info (const char *filename); - // Export all RT_Info to the named file. - - status_t identify_threads (); - // Assembles RT_Tasks into threads. - - status_t aggregate_thread_parameters (); - // Stores the aggregated thread parameters at each leaf (thread delineator) - // in the tread_info_ array. - - u_int find_number_of_threads (mode_t mode); - // Counts the number of threads in a mode based on the task dependencies. - - status_t find_thread_delineators (mode_t mode); - // Find and store the thread delineators: they have no dependencies - // and have a specified rate, or they have internal threads of their own. - - status_t find_dependency_chain_roots (mode_t mode); - // Find and store the roots of dependency chains. - - status_t find_dependency_chain_leaves (); - // Find and store the leaves of dependency chains. - - status_t generate_timeline ( - Mode_Entry const sorted_rt_info [], - const u_int number_of_tasks, - u_long frame_size, - ACE_Unbounded_Queue <Timeline_Entry> &jobs); - - status_t create_timelines (const char *filename); - // Create a timeline for each mode. - - // the following functions are not implememented - Scheduler_Internal (const Scheduler_Internal &); - Scheduler_Internal &operator= (const Scheduler_Internal &); -}; - - -#if defined (__ACE_INLINE__) -#include "Scheduler_Internal.i" -#endif /* __ACE_INLINE__ */ - -#endif /* SCHEDULER_INTERNAL_H */ - - -// EOF diff --git a/TAO/local/bin/Scheduling_Service/Scheduler_Internal.i b/TAO/local/bin/Scheduling_Service/Scheduler_Internal.i deleted file mode 100644 index 91ee5915070..00000000000 --- a/TAO/local/bin/Scheduling_Service/Scheduler_Internal.i +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// sched -// -// = FILENAME -// Scheduler_Internal.i -// -// = CREATION DATE -// 23 January 1997 -// -// = AUTHOR -// David Levine -// -// ============================================================================ - - -// EOF - diff --git a/TAO/local/bin/Scheduling_Service/dump_schedule.cpp b/TAO/local/bin/Scheduling_Service/dump_schedule.cpp deleted file mode 100644 index 01fed0eed6f..00000000000 --- a/TAO/local/bin/Scheduling_Service/dump_schedule.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// $Id$ -// - -#include "ace/Sched_Params.h" -#include "ace/Get_Opt.h" -#include "tao/corba.h" - -#include "CosNamingC.h" -#include "Scheduler_Factory.h" - -// This program dumps the results of one scheduling in a C++ file. - - - -int main (int argc, char *argv[]) -{ - ACE_TRY - { - // Initialize ORB. - CORBA::ORB_ptr orb = - CORBA::ORB_init (argc, argv, "dump_schedule", ACE_TRY_ENV); - ACE_CHECK_ENV; - - CORBA::POA_ptr poa = - orb->POA_init(argc, argv, "POA"); - if (poa == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - } - -#if 0 - CORBA::Object_ptr objref = - orb->resolve_initial_references ("NameService"); - ACE_CHECK_ENV; - CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (objref, ACE_TRY_ENV); - ACE_CHECK_ENV; - - ACE_Scheduler_Factory::use_config (naming_context); -#else - ACE_Scheduler_Factory::use_config (orb); -#endif /* 0 */ - - RtecScheduler::RT_Info_Set* infos; - ACE_Scheduler_Factory::server ()->compute_scheduling - (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, - ACE_SCOPE_THREAD), - ACE_Sched_Params::priority_max (ACE_SCHED_FIFO, - ACE_SCOPE_THREAD), - infos, ACE_TRY_ENV); - ACE_CHECK_ENV; - - ACE_Scheduler_Factory::dump_schedule (*infos, - "Scheduler_Runtime.cpp"); - delete infos; - } - ACE_CATCH (CORBA::SystemException, sys_ex) - { - ACE_TRY_ENV.print_exception ("SYS_EX"); - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/local/bin/Scheduling_Service/schedule_service.cpp b/TAO/local/bin/Scheduling_Service/schedule_service.cpp deleted file mode 100644 index 8be94d60c93..00000000000 --- a/TAO/local/bin/Scheduling_Service/schedule_service.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// -// $Id$ -// - -#include "tao/corba.h" - -#include "CosNamingC.h" -#include "Config_Scheduler.h" - -int main (int argc, char *argv[]) -{ - ACE_TRY - { - // Initialize ORB. - CORBA::ORB_ptr orb = - CORBA::ORB_init (argc, argv, "internet", ACE_TRY_ENV); - ACE_CHECK_ENV; - - CORBA::POA_ptr poa = - orb->POA_init(argc, argv, "POA"); - if (poa == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - } - -#if 0 - CORBA::Object_ptr objref = - orb->resolve_initial_references ("NameService"); - ACE_CHECK_ENV; - - CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (objref, ACE_TRY_ENV); - ACE_CHECK_ENV; -#endif - - // Create an Scheduling service servant... - RtecScheduler::Scheduler_ptr scheduler = new ACE_Config_Scheduler; - // CORBA::Object::_duplicate(scheduler); - ACE_CHECK_ENV; - - CORBA::String str = - orb->object_to_string (scheduler, ACE_TRY_ENV); - ACE_OS::puts ((char *) str); - -#if 0 - // Register the servant with the Naming Context.... - CosNaming::Name schedule_name (1); - schedule_name[0].id = CORBA::string_dup ("ScheduleService"); - schedule_name.length (1); - naming_context->bind (schedule_name, scheduler, ACE_TRY_ENV); - ACE_CHECK_ENV; -#endif - - ACE_DEBUG ((LM_DEBUG, "running scheduling service\n")); - if (orb->run () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), 1); - } - - CORBA::release (scheduler); - } - ACE_CATCHANY - { - ACE_TRY_ENV.print_exception ("schedule_service"); - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/local/bin/Scheduling_Service/svc.conf b/TAO/local/bin/Scheduling_Service/svc.conf deleted file mode 100644 index 43c6a486c92..00000000000 --- a/TAO/local/bin/Scheduling_Service/svc.conf +++ /dev/null @@ -1,49 +0,0 @@ -# $Id$ -# -# This file contains a sample ACE_Service_Config configuration -# file specifying the strategy factories utilized by an application -# using TAO. There are currently only two possible factories: -# Client_Strategy_Factory and Server_Strategy_Factory. These names -# must be used as the second argument to their corresponding line, -# because that's what the ORB uses to find the desired factory. -# -# Note that there are two unordinary characteristics of the way *this* -# file is set up: -# - both client and server strategies are specified in the same -# file, which would only make sense for co-located clients & servers -# - both of the factories are actually sourced out of libTAO.so -# (TAO.DLL on Win32), and they would normally be in a separate -# dll from the TAO ORB Core. -# -# The options which can be passed to the Resource Factory are: -# -# -ORBresources <which> -# where <which> can be 'global' to specify globally-held resources, -# or 'tss' to specify thread-specific resources. -# -# The options which can be passed to the Client are: -# <none currently> -# -# The options which can be passed to the Server are: -# -# -ORBconcurrency <which> -# where <which> can be 'thread-per-connection' to specify -# use of the ACE_Threaded_Strategy concurrency strategy, -# or 'reactive' to specify use of the ACE_Reactive_Strategy -# concurrency strategy. -# -# -ORBthreadflags <flags> -# specifies the default thread flags to use, where <flags> is a -# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, -# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid -# on every platform. -# -# -ORBdemuxstrategy <which> -# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', -# and specifies the type of object lookup strategy used internally. -# -ORBtablesize <unsigned> -# specifies the size of the object table -# -dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" -dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() -dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" |