Closed marrub-- closed 7 years ago
This will be extremely useful, as one of the things I ran into trying to implement on different engines was intensive map procedural generation halting the main thread while it ran. The proper behavior would be to do this kind of intensive work in a thread(s) so that things such as a loading screen and progress could be displayed.
Closing this because OpenMP is now part of the CMakeLists. Any time threading can be easily applied it should be, but it's obviously not something one should go out of their way for.
We have manual threading, C++11 threading, and script threading.
I'm thinking, though, that OpenMP may be useful as well for certain big operations which have no mutual exclusion needs.
OpenMP is fairly unintrusive, providing compiler pragmas when supported.
For example:
Compile with
clang++ openmptest.cpp -std=c++1z -o b.out
and you get:But, compile with
clang++ openmptest.cpp -std=c++1z -DUSEOPENMP -fopenmp -o a.out
and,A very noticable increase in speed, essentially for free, just by adding a compiler pragma.
Thoughts?