Implement a function that creates C++11 threads
BRL-CAD implements support for running in parallel on computers with multiple CPUs and multiple cores. However, there are lots of ways to run in parallel. One of those ways recently added to C++11 is std::thread. This task involves implementing the necessary logic to create a new thread in bu_parallel() using std::thread.
This requires a minor source code modification to BRL-CAD's bu_parallel() function, located in:
- src/libbu/parallel.c
You may optionally want to add/modify these:
- src/libbu/parallel_cpp11thread.cpp
- src/libbu/CMakelists.txt
You can put your implementation into a .cpp file or add your own new file and call a function from parallel.c, whatever is easiest. You can toggle usage of your implementation in parallel.c on whether HAVE_THREAD_LOCAL is defined. Be sure to run "ctest -R bu_parallel" when you think you have it working to test your change. Be sure the tests are calling your code and get them to pass.
SUBMIT a patch file with your changes. You'll need to "svn add src/libbu/parallel_cpp11thread.cpp" (or however you name it) if you add a new file. See https://brlcad.org/wiki/Patches