I am updating a CRAN package that needs C++ compilation. CRAN forbids std::cout <<
but allows Rcpp::Rcout <<
. The latter however crashes the program in a multithreaded environment. I am using RcppParallel
for multithreading. Is there an alternative without importing new R packages besides Rcpp
and RcppParallel
?
Thank you!
A solution: put Rcpp::Rcout << ...
in a tbb::spin_mutex
locking scope.