From 91db6ba6a3466dc9834d1fca0bea98efa2ff8584 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 10 Mar 2022 17:21:30 +0100 Subject: [PATCH] Kill dead code. Unused since there is no future. --- src/kernel/EngineImpl.cpp | 32 ++------------------------------ src/kernel/EngineImpl.hpp | 4 ---- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index 39f49ee81b..b105c175be 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -474,27 +474,6 @@ actor::ActorImpl* EngineImpl::get_actor_by_pid(aid_t pid) return nullptr; // Not found, even in the trash } -/** Execute all the tasks that are queued, e.g. `.then()` callbacks of futures. */ -bool EngineImpl::execute_tasks() -{ - if (tasks.empty()) - return false; - - std::vector> tasksTemp; - do { - // We don't want the callbacks to modify the vector we are iterating over: - tasks.swap(tasksTemp); - - // Execute all the queued tasks: - for (auto& task : tasksTemp) - task(); - - tasksTemp.clear(); - } while (not tasks.empty()); - - return true; -} - void EngineImpl::remove_daemon(actor::ActorImpl* actor) { auto it = daemons_.find(actor); @@ -722,8 +701,6 @@ void EngineImpl::run(double max_date) #endif } - execute_tasks(); - while (not actors_to_run_.empty()) { XBT_DEBUG("New Sub-Schedule Round; size(queue)=%zu", actors_to_run_.size()); @@ -757,10 +734,7 @@ void EngineImpl::run(double max_date) if (actor->simcall_.call_ != actor::Simcall::Type::NONE) actor->simcall_handle(0); - execute_tasks(); - do { - wake_all_waiting_actors(); - } while (execute_tasks()); + wake_all_waiting_actors(); /* If only daemon actors remain, cancel their actions, mark them to die and reschedule them */ if (actor_list_.size() == daemons_.size()) @@ -787,12 +761,10 @@ void EngineImpl::run(double max_date) /* FIXME: iterate through the list of failed host and mark each of them */ /* as failed. On each host, signal all the running actors with host_fail */ - // Execute timers and tasks until there isn't anything to be done: + // Execute timers until there isn't anything to be done: bool again = false; do { again = timer::Timer::execute_all(); - if (execute_tasks()) - again = true; wake_all_waiting_actors(); } while (again); diff --git a/src/kernel/EngineImpl.hpp b/src/kernel/EngineImpl.hpp index 82013ced9b..01642e8050 100644 --- a/src/kernel/EngineImpl.hpp +++ b/src/kernel/EngineImpl.hpp @@ -65,8 +65,6 @@ class EngineImpl { xbt_dynar_t actors_vector_ = xbt_dynar_new(sizeof(actor::ActorImpl*), nullptr); #endif - std::vector> tasks; - static EngineImpl* instance_; actor::ActorImpl* maestro_ = nullptr; context::ContextFactory* context_factory_ = nullptr; @@ -158,8 +156,6 @@ public: const std::vector& get_actors_to_run() const { return actors_to_run_; } const std::vector& get_actors_that_ran() const { return actors_that_ran_; } - bool execute_tasks(); - void add_task(xbt::Task&& t) { tasks.push_back(std::move(t)); } void wake_all_waiting_actors() const; /** * Garbage collection -- 2.20.1