rcpp_progress
rcpp_progress copied to clipboard
Multithreading agnostic progress bar (RcppParallel, pthreads, openmp)
I wrote a short gist based on the idea in this package that should work for RcppParallel and any other multithreading framework. https://gist.github.com/traversc/8b26b9e689b23d3a174aee296c0503ca
I think this general approach would be nice to see in this package.
The changes you'd need to make are not too many. In summary:
- counter ->
std::atomic - increment ->
counter.fetch_add(1) - Check for main thread ->
std::this_thread::get_id()
Hello, What are the practical advantages ?
The practical advantage is it should work using RcppParallel or C++ std::threads.