diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/RtecScheduler.idl | 3 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp | 79 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp | 122 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/DynSched.h | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i | 3 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp | 14 |
10 files changed, 139 insertions, 90 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp index 59fcc98f024..e887c23d7d0 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway.cpp @@ -86,7 +86,7 @@ TAO_EC_Gateway_IIOP::init (RtecEventChannelAdmin::EventChannel_ptr rmt_ec, RtecScheduler::VERY_LOW_IMPORTANCE, time, 1, - RtecScheduler::OPERATION, + RtecScheduler::REMOTE_DEPENDANT, _env); if (_env.exception () != 0) return; diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.cpp index 04e3d37b611..17175554ab6 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_UDP.cpp @@ -274,7 +274,7 @@ TAO_ECG_UDP_Receiver::init (RtecEventChannelAdmin::EventChannel_ptr lcl_ec, RtecScheduler::VERY_LOW_IMPORTANCE, time, 1, - RtecScheduler::OPERATION, + RtecScheduler::REMOTE_DEPENDANT, _env); if (_env.exception () != 0) return; } diff --git a/TAO/orbsvcs/orbsvcs/RtecScheduler.idl b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl index b9035326884..4b0477c20b3 100644 --- a/TAO/orbsvcs/orbsvcs/RtecScheduler.idl +++ b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl @@ -39,7 +39,8 @@ module RtecScheduler { OPERATION, CONJUNCTION, - DISJUNCTION + DISJUNCTION, + REMOTE_DEPENDANT }; enum Dependency_Type diff --git a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp index 821de41e549..a2dc0c1362a 100644 --- a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp +++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp @@ -27,13 +27,13 @@ ACE_Runtime_Scheduler::create (const char * entry_point, TAO_THROW_SPEC ((CORBA::SystemException, RtecScheduler::DUPLICATE_NAME)) { - // Just make sure its there and returns its handle (position). + // Just make sure it's there and return its handle. int i; for (i = 0; i < entry_count_; ++i) { if (strcmp (entry_point, rt_info_[i].entry_point) == 0) { - return i; + return i + 1; } } // TODO: throw an exception or print an error. @@ -54,7 +54,7 @@ ACE_Runtime_Scheduler::get (RtecScheduler::handle_t handle, TAO_THROW_SPEC((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK)) { - if (handle < 0 || handle > entry_count_) + if (handle <= 0 || handle > entry_count_) { TAO_THROW_RETURN (RtecScheduler::UNKNOWN_TASK(), 0); } @@ -65,20 +65,20 @@ ACE_Runtime_Scheduler::get (RtecScheduler::handle_t handle, RtecScheduler::RT_Info* info = new RtecScheduler::RT_Info; - info->entry_point = rt_info_[handle].entry_point; - info->handle = rt_info_[handle].handle; - info->worst_case_execution_time = rt_info_[handle].worst_case_execution_time; - info->typical_execution_time = rt_info_[handle].typical_execution_time; - info->cached_execution_time = rt_info_[handle].cached_execution_time; - info->period = rt_info_[handle].period; - info->criticality = RtecScheduler::Criticality(rt_info_[handle].criticality); - info->importance = RtecScheduler::Importance(rt_info_[handle].importance); - info->quantum = rt_info_[handle].quantum; - info->threads = rt_info_[handle].threads; - info->priority = rt_info_[handle].priority; - info->preemption_subpriority = rt_info_[handle].static_subpriority; - info->preemption_priority = rt_info_[handle].preemption_priority; - info->info_type = RtecScheduler::Info_Type(rt_info_[handle].info_type); + info->entry_point = rt_info_[handle - 1].entry_point; + info->handle = rt_info_[handle - 1].handle; + info->worst_case_execution_time = rt_info_[handle - 1].worst_case_execution_time; + info->typical_execution_time = rt_info_[handle - 1].typical_execution_time; + info->cached_execution_time = rt_info_[handle - 1].cached_execution_time; + info->period = rt_info_[handle - 1].period; + info->criticality = RtecScheduler::Criticality(rt_info_[handle - 1].criticality); + info->importance = RtecScheduler::Importance(rt_info_[handle - 1].importance); + info->quantum = rt_info_[handle - 1].quantum; + info->threads = rt_info_[handle - 1].threads; + info->priority = rt_info_[handle - 1].priority; + info->preemption_subpriority = rt_info_[handle - 1].static_subpriority; + info->preemption_priority = rt_info_[handle - 1].preemption_priority; + info->info_type = RtecScheduler::Info_Type(rt_info_[handle - 1].info_type); return info; } @@ -99,23 +99,25 @@ void ACE_Runtime_Scheduler::set (RtecScheduler::handle_t handle, { // We compare the values with the ones stored and print a message on // any differences. - if (handle < 0 || handle > entry_count_) + if (handle <= 0 || handle > entry_count_) { + ACE_DEBUG ((LM_DEBUG, "Unknown task: no entry for handle %d\n", + handle)); TAO_THROW (RtecScheduler::UNKNOWN_TASK()); // NOTREACHED } - if (rt_info_[handle].worst_case_execution_time != time - || rt_info_[handle].typical_execution_time != typical_time - || rt_info_[handle].cached_execution_time != cached_time - || rt_info_[handle].period != period - || rt_info_[handle].criticality != criticality - || rt_info_[handle].importance != importance - || rt_info_[handle].quantum != quantum - || rt_info_[handle].info_type != info_type - || rt_info_[handle].threads != threads) + if (rt_info_[handle - 1].worst_case_execution_time != time + || rt_info_[handle - 1].typical_execution_time != typical_time + || rt_info_[handle - 1].cached_execution_time != cached_time + || rt_info_[handle - 1].period != period + || rt_info_[handle - 1].criticality != criticality + || rt_info_[handle - 1].importance != importance + || rt_info_[handle - 1].quantum != quantum + || rt_info_[handle - 1].info_type != info_type + || rt_info_[handle - 1].threads != threads) { ACE_ERROR ((LM_ERROR, "invalid data for RT_Info: %s\n", - (const char*)rt_info_[handle].entry_point)); + (const char*)rt_info_[handle - 1].entry_point)); // TODO: throw something here. } } @@ -130,14 +132,15 @@ void ACE_Runtime_Scheduler::priority (RtecScheduler::handle_t handle, RtecScheduler::UNKNOWN_TASK, RtecScheduler::NOT_SCHEDULED)) { - if (handle < 0 || handle > entry_count_) + if (handle <= 0 || handle > entry_count_) { TAO_THROW (RtecScheduler::UNKNOWN_TASK()); // NOTREACHED } - priority = rt_info_[handle].priority; - subpriority = rt_info_[handle].static_subpriority; - p_priority = rt_info_[handle].preemption_priority; + + priority = rt_info_[handle - 1].priority; + subpriority = rt_info_[handle - 1].static_subpriority; + p_priority = rt_info_[handle - 1].preemption_priority; // ACE_DEBUG ((LM_DEBUG, "(%t) Returning priority %d\n", priority)); } @@ -168,14 +171,14 @@ void ACE_Runtime_Scheduler::add_dependency (RtecScheduler::handle_t handle, TAO_THROW_SPEC ((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK)) { - if (handle < 0 || handle > entry_count_) + if (handle <= 0 || handle > entry_count_) { TAO_THROW (RtecScheduler::UNKNOWN_TASK()); // NOTREACHED } #if 0 // Just check that the information is consistent. - RtecScheduler::Dependency_Set& deps = rt_info_[handle]->dependencies; + RtecScheduler::Dependency_Set& deps = rt_info_[handle - 1]->dependencies; for (CORBA::ULong i = 0; i < deps.length (); ++i) { if (deps[i].rt_info == dependency @@ -186,7 +189,7 @@ void ACE_Runtime_Scheduler::add_dependency (RtecScheduler::handle_t handle, } } ACE_ERROR ((LM_ERROR, "unmatched dependency on %s\n", - (const char*)rt_info_[handle]->entry_point)); + (const char*)rt_info_[handle - 1]->entry_point)); #endif } @@ -208,9 +211,9 @@ void ACE_Runtime_Scheduler::compute_scheduling (CORBA::Long minimum_priority, void ACE_Runtime_Scheduler::dispatch_configuration(RtecScheduler::Preemption_Priority p_priority, - RtecScheduler::OS_Priority& priority, - RtecScheduler::Dispatching_Type & d_type, - CORBA::Environment &_env) + RtecScheduler::OS_Priority& priority, + RtecScheduler::Dispatching_Type & d_type, + CORBA::Environment &_env) TAO_THROW_SPEC ((CORBA::SystemException, RtecScheduler::NOT_SCHEDULED, RtecScheduler::UNKNOWN_PRIORITY_LEVEL)) diff --git a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp index 9b28b0e10e6..f3ab7a88383 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/Config_Scheduler.cpp @@ -321,8 +321,6 @@ void ACE_Config_Scheduler::compute_scheduling (CORBA::Long minimum_priority, } - - void ACE_Config_Scheduler::dispatch_configuration (RtecScheduler::Preemption_Priority p_priority, RtecScheduler::OS_Priority& priority, RtecScheduler::Dispatching_Type & d_type, diff --git a/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp b/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp index 142e162a985..d7c016a325a 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/DynSched.cpp @@ -109,6 +109,8 @@ ACE_DynScheduler::status_message (ACE_DynScheduler::status_t status) return "INSUFFICIENT_THREAD_PRIORITY_LEVELS"; case ST_CYCLE_IN_DEPENDENCIES : return "CYCLE_IN_DEPENDENCIES"; + case ST_UNRESOLVED_REMOTE_DEPENDENCIES : + return "ST_UNRESOLVED_REMOTE_DEPENDENCIES"; case ST_INVALID_PRIORITY_ORDERING : return "INVALID_PRIORITY_ORDERING"; case UNABLE_TO_OPEN_SCHEDULE_FILE : @@ -243,7 +245,7 @@ ACE_DynScheduler::register_task (RT_Info *rt_info, handle_t &handle) ACE_DynScheduler::status_t ACE_DynScheduler::get_rt_info (Object_Name name, - RT_Info* &rtinfo) + RT_Info* &rtinfo) { handle_t handle; @@ -650,59 +652,79 @@ ACE_DynScheduler::schedule (void) status_ = identify_threads (); } - if (status_ == SUCCEEDED) + if ((status_ == SUCCEEDED) || (status_ == ST_UNRESOLVED_REMOTE_DEPENDENCIES)) { // invokes the internal thread scheduling method of the strategy - status_ = schedule_threads (); + temp_status = schedule_threads (); + if (temp_status != SUCCEEDED) + { + status_ == temp_status; + } } - if (status_ == SUCCEEDED) + if ((status_ == SUCCEEDED) || (status_ == ST_UNRESOLVED_REMOTE_DEPENDENCIES)) { // propagate the dispatch information from the // threads throughout the call graph - status_ = propagate_dispatches (); + temp_status = propagate_dispatches (); + if (temp_status != SUCCEEDED) + { + status_ == temp_status; + } } - if (status_ == SUCCEEDED) + if ((status_ == SUCCEEDED) || (status_ == ST_UNRESOLVED_REMOTE_DEPENDENCIES)) { // invokes the internal dispatch scheduling method of the strategy - status_ = schedule_dispatches (); + temp_status = schedule_dispatches (); + if (temp_status != SUCCEEDED) + { + status_ == temp_status; + } } // calculate utilization, total frame size, critical set - if (status_ == SUCCEEDED) + if ((status_ == SUCCEEDED) || (status_ == ST_UNRESOLVED_REMOTE_DEPENDENCIES)) { - status_ = calculate_utilization_params (); + temp_status = calculate_utilization_params (); + if (temp_status != SUCCEEDED) + { + status_ == temp_status; + } } // calculate utilization, total frame size, critical set - if ((status_ == SUCCEEDED) || (status_ == ST_UTILIZATION_BOUND_EXCEEDED)) + if ((status_ == SUCCEEDED) || (status_ == ST_UTILIZATION_BOUND_EXCEEDED) || + (status_ == ST_UNRESOLVED_REMOTE_DEPENDENCIES)) { - status_ = store_assigned_info (); + temp_status = store_assigned_info (); + if (temp_status != SUCCEEDED) + { + status_ == temp_status; + } } // generate the scheduling timeline over the total frame size - if ((status_ == SUCCEEDED) || (status_ == ST_UTILIZATION_BOUND_EXCEEDED)) + if ((status_ == SUCCEEDED) || (status_ == ST_UTILIZATION_BOUND_EXCEEDED) || + (status_ == ST_UNRESOLVED_REMOTE_DEPENDENCIES)) { temp_status = create_timeline (); - } - - if (temp_status != SUCCEEDED) - { - status_ = temp_status; + if (temp_status != SUCCEEDED) + { + status_ = temp_status; + } } // store the timeline to a file if one was given if ((timeline_filename_ != 0) && ((status_ == SUCCEEDED) || (status_ == ST_UTILIZATION_BOUND_EXCEEDED))) - { - temp_status = output_timeline (timeline_filename_, 0); - } - - if (temp_status != SUCCEEDED) - { - status_ = temp_status; - } + { + temp_status = output_timeline (timeline_filename_, 0); + if (temp_status != SUCCEEDED) + { + status_ = temp_status; + } + } // if a valid schedule was not generated, clean up from the attempt switch (status_) @@ -710,6 +732,7 @@ ACE_DynScheduler::schedule (void) // these are statuses that indicate a reasonable schedule was generated case SUCCEEDED: case ST_UTILIZATION_BOUND_EXCEEDED: + case ST_UNRESOLVED_REMOTE_DEPENDENCIES: // if we made it here, the schedule is done up_to_date_ = 1; @@ -810,9 +833,12 @@ ACE_DynScheduler::calculate_utilization_params (void) minimum_priority_queue_ = ordered_dispatch_entries_ [i]->priority (); } - // only consider computation times of dispatches on OPERATION descriptors - if ((ordered_dispatch_entries_ [i]->task_entry ().info_type () == - RtecScheduler::OPERATION) && + // Only consider computation times of dispatches of + // OPERATION and REMOTE_DEPENDANT descriptors. + if (((ordered_dispatch_entries_ [i]->task_entry ().info_type () == + RtecScheduler::OPERATION) || + (ordered_dispatch_entries_ [i]->task_entry ().info_type () == + RtecScheduler::REMOTE_DEPENDANT)) && (ordered_dispatch_entries_ [i]->task_entry ().effective_period () > 0)) { utilization_ += @@ -1018,6 +1044,7 @@ ACE_DynScheduler::status_t ACE_DynScheduler::identify_threads (void) { u_int i, j; + ACE_DynScheduler::status_t result = SUCCEEDED; // walk array of task entries, picking out thread delineators for (i = 0; i < tasks_; i++) @@ -1062,21 +1089,30 @@ ACE_DynScheduler::identify_threads (void) ++ threads_; } } + else if (task_entries_ [i].rt_info ()->info_type == RtecScheduler::REMOTE_DEPENDANT) + { + // Warn about unresolved remote dependencies + result = ST_UNRESOLVED_REMOTE_DEPENDENCIES; + ACE_DEBUG ( + (LM_DEBUG, + "An operation identified by \"%s\" has unresolved remote dependencies\n.", + (const char*) task_entries_ [i].rt_info ()->entry_point)); + } else - { - // node that no one calls and has neither rate nor threads is suspect - ACE_ERROR_RETURN ( - (LM_ERROR, - "An operation identified by \"%s\" does not specify a period or\n" - "visible threads, and is not called by any other operation. " - "Are there backwards dependencies?\n", - (const char*) task_entries_ [i].rt_info ()->entry_point), - ST_BAD_DEPENDENCIES_ON_TASK); - } + { + // Local node that no one calls and has neither rate nor threads is suspect + ACE_ERROR_RETURN ( + (LM_ERROR, + "An operation identified by \"%s\" does not specify a period or\n" + "visible threads, and is not called by any other operation. " + "Are there backwards dependencies?\n", + (const char*) task_entries_ [i].rt_info ()->entry_point), + ST_BAD_DEPENDENCIES_ON_TASK); + } } } - return SUCCEEDED; + return result; } ACE_DynScheduler::status_t @@ -1305,9 +1341,11 @@ ACE_DynScheduler::create_timeline () max_dispatch_id_ = ordered_dispatch_entries_[i]->dispatch_id (); } - // only put OPERATION dispatches into the timeline. - if (ordered_dispatch_entries_[i]->task_entry().info_type () != - RtecScheduler::OPERATION) + // only put OPERATION and REMOTE_DEPENDANT dispatches into the timeline. + if ((ordered_dispatch_entries_[i]->task_entry().info_type () != + RtecScheduler::OPERATION) && + (ordered_dispatch_entries_[i]->task_entry().info_type () != + RtecScheduler::REMOTE_DEPENDANT)) { continue; } diff --git a/TAO/orbsvcs/orbsvcs/Sched/DynSched.h b/TAO/orbsvcs/orbsvcs/Sched/DynSched.h index 5c94f954eb9..3d44e52ca59 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/DynSched.h +++ b/TAO/orbsvcs/orbsvcs/Sched/DynSched.h @@ -89,6 +89,7 @@ public: , ST_UTILIZATION_BOUND_EXCEEDED , ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS , ST_CYCLE_IN_DEPENDENCIES + , ST_UNRESOLVED_REMOTE_DEPENDENCIES , ST_INVALID_PRIORITY_ORDERING , UNABLE_TO_OPEN_SCHEDULE_FILE , UNABLE_TO_WRITE_SCHEDULE_FILE diff --git a/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp index 860bcd5e0bf..ff2072d4dcd 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.cpp @@ -165,6 +165,7 @@ Task_Entry::merge_dispatches (ACE_Unbounded_Set <Dispatch_Entry *> &dispatch_ent break; case RtecScheduler::OPERATION: + case RtecScheduler::REMOTE_DEPENDANT: // disjunctively merge the operation's two-way dispatches, // and conjunctively merge its one-way dispatches. diff --git a/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i index 777bb86fc5c..772770706b2 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i +++ b/TAO/orbsvcs/orbsvcs/Sched/SchedEntry.i @@ -135,7 +135,8 @@ Task_Entry::effective_execution_time () const ACE_UINT32 worst_case_execution_time = ACE_U64_TO_U32 (rt_info_->worst_case_execution_time); - return (rt_info_->info_type == RtecScheduler::OPERATION) + return ((rt_info_->info_type == RtecScheduler::OPERATION) || + (rt_info_->info_type == RtecScheduler::REMOTE_DEPENDANT)) ? worst_case_execution_time * dispatches_.size () : 0; } diff --git a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp index 508f9f699fb..5553cde5589 100644 --- a/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp @@ -51,7 +51,7 @@ static ACE_Scheduler_Factory_Data *ace_scheduler_factory_data = 0; int ACE_Scheduler_Factory::use_runtime (int cc, POD_Config_Info cfgi[], - int ec, + int ec, POD_RT_Info rti[]) { if (server_ != 0 || TAO_SF_entry_count != -1) @@ -186,7 +186,7 @@ static char footer[] = "\n" "// This sets up Scheduler_Factory to use the runtime version\n" "int scheduler_factory_setup = \n" -" ACE_Scheduler_Factory::use_runtime (infos_size, infos);\n" +" ACE_Scheduler_Factory::use_runtime (configs_size, configs, infos_size, infos);\n" "\n" "// EOF\n"; @@ -221,11 +221,12 @@ int ACE_Scheduler_Factory::dump_schedule const char* config_info_format) { u_int i; + char entry_point [BUFSIZ]; // default format for printing RT_Info output if (rt_info_format == 0) { - rt_info_format = "{ \"%20s\", %10d, %10d, %10d, " + rt_info_format = "{%20s, %10d, %10d, %10d, " "%10d, %10d, " "(RtecScheduler::Criticality) %d, " "(RtecScheduler::Importance) %d, " @@ -260,12 +261,17 @@ int ACE_Scheduler_Factory::dump_schedule // Finish previous line ACE_OS::fprintf(file, ",\n"); } + const RtecScheduler::RT_Info& info = infos[i]; + + // Put quotes around the entry point name, exactly as it is stored. + ACE_OS::sprintf (entry_point, "\"%s\"", (const char*) info.entry_point); + // @@ 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, rt_info_format, - (const char*) info.entry_point, + entry_point, info.handle, ACE_CU64_TO_CU32 (info.worst_case_execution_time), ACE_CU64_TO_CU32 (info.typical_execution_time), |