-
Notifications
You must be signed in to change notification settings - Fork 297
Open
Description
Hey I'm kinda new to c++ stuff and I've been trying to use multi-threading, because I just have watched a video about it :)..
I want to ask you, why this approach doesn't work?
it seems to have no effect on the CPU usage.
this is the original code for one of the most time-consuming tasks:
for (Colony& colony : colonies)
{
colony.update(dt, world);
}
and this is what I done:
for_each(std::execution::par,colonies.begin(), colonies.end(),
[&dt, this](Colony& colony){
colony.update(dt, world);
});
May I have your opinion?
Metadata
Metadata
Assignees
Labels
No labels