change parallel_for to threads

This commit is contained in:
chatlanin 2023-03-21 12:57:31 +03:00
parent 7cf7223305
commit 116fda7579
2 changed files with 13 additions and 4 deletions

View File

@ -18,11 +18,20 @@ namespace try_engine::app_event
void execute(std::any type, std::any value) void execute(std::any type, std::any value)
{ {
tbb::parallel_for(tbb::blocked_range<int>(0, l_stack.size()), [&](tbb::blocked_range<int> r) for (const auto layer : l_stack)
{ {
for (int i = r.begin(); i < r.end(); ++i) std::thread th {
l_stack[i]->on_event(type, value); [=]() {
}); layer->on_event(type, value);
}
};
th.detach();
}
// tbb::parallel_for(tbb::blocked_range<int>(0, l_stack.size()), [&](tbb::blocked_range<int> r) {
// for (int i = r.begin(); i < r.end(); ++i)
// l_stack[i]->on_event(type, value);
// });
} }
void print_size(); void print_size();

Binary file not shown.