From 5f9b2b682bd413af92a820c3672b83b2fc890c43 Mon Sep 17 00:00:00 2001 From: chatlanin Date: Tue, 21 Mar 2023 13:57:27 +0300 Subject: [PATCH] return parallel --- src/try_engine/event/app_event/event.hpp | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/try_engine/event/app_event/event.hpp b/src/try_engine/event/app_event/event.hpp index 4857903..98aa03f 100644 --- a/src/try_engine/event/app_event/event.hpp +++ b/src/try_engine/event/app_event/event.hpp @@ -18,20 +18,20 @@ namespace try_engine::app_event void execute(std::any type, std::any value) { - for (const auto layer : l_stack) - { - std::thread th { - [=]() { - layer->on_event(type, value); - } - }; - th.detach(); - } + // for (const auto layer : l_stack) + // { + // std::thread th { + // [=]() { + // layer->on_event(type, value); + // } + // }; + // th.detach(); + // } - // tbb::parallel_for(tbb::blocked_range(0, l_stack.size()), [&](tbb::blocked_range r) { - // for (int i = r.begin(); i < r.end(); ++i) - // l_stack[i]->on_event(type, value); - // }); + tbb::parallel_for(tbb::blocked_range(0, l_stack.size()), [&](tbb::blocked_range r) { + for (int i = r.begin(); i < r.end(); ++i) + l_stack[i]->on_event(type, value); + }); } void print_size();