diff options
author | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-16 19:35:15 +0000 |
---|---|---|
committer | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-16 19:35:15 +0000 |
commit | 963fb94e405f1a6f0116b06905653c039ea9268f (patch) | |
tree | bb48b6051f8e93c6bd58d3cc67dc3155eed42507 | |
parent | a9fb91d8d4c62b8fa891021371247c37484345f9 (diff) | |
download | ATCD-963fb94e405f1a6f0116b06905653c039ea9268f.tar.gz |
added usability features to scheduling service
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp | 68 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp | 25 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Scheduler_Factory.h | 25 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Scheduler_Factory.i | 19 |
5 files changed, 63 insertions, 75 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp index d9c02547440..53cdbd03f16 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp @@ -288,74 +288,6 @@ void ACE_Config_Scheduler::compute_scheduling (CORBA::Long minimum_priority, } -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - #if defined (TAO_USES_STRATEGY_SCHEDULER) - #if defined (TAO_USES_MUF_SCHEDULING) - - template class ACE_Strategy_Scheduler_Factory<ACE_MUF_Scheduler_Strategy>; - - #elif defined (TAO_USES_MLF_SCHEDULING) - - template class ACE_Strategy_Scheduler_Factory<ACE_MLF_Scheduler_Strategy>; - - #elif defined (TAO_USES_EDF_SCHEDULING) - - template class ACE_Strategy_Scheduler_Factory<ACE_EDF_Scheduler_Strategy>; - - #elif defined (TAO_USES_RMS_SCHEDULING) - - template class ACE_Strategy_Scheduler_Factory<ACE_RMS_Scheduler_Strategy>; - - #elif defined (TAO_USES_RMS_DYN_SCHEDULING) - - template class ACE_Strategy_Scheduler_Factory<ACE_RMS_Dyn_Scheduler_Strategy>; - - #else - - #error scheduling strategy must be defined - - #endif /* defined (TAO_USES_MUF_SCHEDULING) */ - #endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */ - -#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - #if defined (TAO_USES_STRATEGY_SCHEDULER) - #if defined (TAO_USES_MUF_SCHEDULING) - - #pragma instantiate ACE_Strategy_Scheduler_Factory<ACE_MUF_Scheduler_Strategy> - - #elif defined (TAO_USES_MLF_SCHEDULING) - - #pragma instantiate ACE_Strategy_Scheduler_Factory<ACE_MLF_Scheduler_Strategy> - - #elif defined (TAO_USES_EDF_SCHEDULING) - - #pragma instantiate ACE_Strategy_Scheduler_Factory<ACE_EDF_Scheduler_Strategy> - - #elif defined (TAO_USES_RMS_SCHEDULING) - - #pragma instantiate ACE_Strategy_Scheduler_Factory<ACE_RMS_Scheduler_Strategy> - - #elif defined (TAO_USES_RMS_DYN_SCHEDULING) - - #pragma instantiate ACE_Strategy_Scheduler_Factory<ACE_RMS_Dyn_Scheduler_Strategy> - - #else - - #error scheduling strategy must be defined - - #endif /* defined (TAO_USES_MUF_SCHEDULING) */ - #endif /* defined (TAO_USES_STRATEGY_SCHEDULER) */ -#endif /* defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) */ - - - - - - - - - - diff --git a/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp b/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp index e617763eb3f..a8eab1d5bea 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp @@ -364,6 +364,7 @@ int ACE_DynScheduler::add_dependency(RT_Info* rt_info, } d.rt_info = temp_info->handle; + break; default: diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp index e72cdf2e12e..0ff75757c00 100644 --- a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp @@ -9,8 +9,10 @@ #include "orbsvcs/Scheduler_Factory.i" #endif /* __ACE_INLINE__ */ +// initialize static class members RtecScheduler::Scheduler_ptr ACE_Scheduler_Factory::server_ = 0; - +ACE_Scheduler_Factory::Factory_Status ACE_Scheduler_Factory::status_ = + ACE_Scheduler_Factory::UNINITIALIZED; static int entry_count = -1; static ACE_Scheduler_Factory::POD_RT_Info* rt_info = 0; @@ -26,6 +28,7 @@ int ACE_Scheduler_Factory::use_runtime (int ec, entry_count = ec; rt_info = rti; + status_ = ACE_Scheduler_Factory::RUNTIME; return 0; } @@ -93,6 +96,8 @@ ACE_Scheduler_Factory::use_config (CosNaming::NamingContext_ptr naming, " exception while resolving server\n"), -1); } TAO_ENDTRY; + + status_ = ACE_Scheduler_Factory::CONFIG; return 0; } @@ -138,8 +143,18 @@ static char end_infos[] = int ACE_Scheduler_Factory::dump_schedule (const RtecScheduler::RT_Info_Set& infos, - const char* filename) + const char* filename, const char* format_string) { + if (format_string == 0) + { + format_string = "{ \"%20s\", %10d, {%10d, %10d}, {%10d, %10d}, " + "{%10d, %10d}, %10d, " + "(RtecScheduler::Criticality) %d, " + "(RtecScheduler::Importance) %d, " + "{%10d, %10d}, %10d, %10d, %10d, %10d, " + "(RtecScheduler::Info_Type) %d }"; + } + FILE* file = stdout; if (filename != 0) { @@ -163,9 +178,8 @@ int ACE_Scheduler_Factory::dump_schedule // @@ TODO Eventually the TimeT structure will be a 64-bit // unsigned int, we will have to change this dump method then. ACE_OS::fprintf (file, - "{ \"%s\", %d, {%d, %d}, {%d, %d}, {%d, %d}, %d,\n" - " %d, %d, {%d, %d}, %d, %d, %d, %d, %d }", - (const char*)info.entry_point, + format_string, + (const char*) info.entry_point, info.handle, info.worst_case_execution_time.low, info.worst_case_execution_time.high, @@ -208,4 +222,3 @@ int ACE_Scheduler_Factory::dump_schedule - diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h index 71e4c20d944..b50167ea2cb 100644 --- a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h @@ -20,6 +20,14 @@ class TAO_ORBSVCS_Export ACE_Scheduler_Factory // actually do the scheduling, without incurring in RPC overheads. { public: + enum Factory_Status {UNINITIALIZED, CONFIG, RUNTIME}; + // = TITLE + // Factory Status + // + // = DESCRIPTION + // This type enumerates the possible states of the factory: + // uninitialized, or in a config or runtime mode of operation. + struct POD_RT_Info // = TITLE // Plain Old Data for RT_Infos. @@ -69,13 +77,18 @@ public: // resolve_initial_references. static int dump_schedule (const RtecScheduler::RT_Info_Set& infos, - const char* file_name = 0); + const char* file_name = 0, + const char* format_string = 0); // This helper function will dump the schedule returned by a // RtecScheduler::Scheduler into a file, the file can be compiled to // create an efficient local implementation of the Scheduler. // TODO: How to do cleanup()? Use the ACE_Object_Manager stuff? + static Factory_Status status (void); + // This helper function allows the application to determine whether the + // factory is uninitialized, or in a config or runtime mode of operation. + protected: static int no_config_run (void); // By default this factory assumes we are runnning a config @@ -88,6 +101,7 @@ protected: private: static RtecScheduler::Scheduler_ptr server_; + static Factory_Status status_; }; #if defined (__ACE_INLINE__) @@ -95,3 +109,12 @@ private: #endif /* __ACE_INLINE__ */ #endif /* ACE_SCHEDULER_FACTORY_H */ + + + + + + + + + diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i index 8d85b9d5a37..fdf6d67856c 100644 --- a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i @@ -4,3 +4,22 @@ // // ============================================================================ +ACE_INLINE ACE_Scheduler_Factory::Factory_Status +ACE_Scheduler_Factory::status (void) +{ + return status_; +} + // This helper function allows the application to determine whether the + // factory is uninitialized, or in a config or runtime mode of operation. + + +// EOF + + + + + + + + + |