change parallel_for to threads
This commit is contained in:
parent
7cf7223305
commit
116fda7579
@ -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.
Reference in New Issue
Block a user