Thank you Dirk. Your observation is correct. I am left with two questions. As always, I appreciate your answers.
1. Except for this single step of calling an R function (model matrix-like objects that are being created by an external library in R), all my other computations are now implemented in C++ & thread friendly. Does this mean I would have no other option but to go serial if I need to call R an function? Do you have any alternative recommendations? I would really love to take advantage of RcppParallel/TBB here, as I have heavily exploited RcppParallel to parallelize everything else. 2. Your RInside calculations in the Boost thread example are multi-threaded, with a locking interface to RInside instance too. I wonder what makes that work well without R reporting issues, while the TBB/rcppParallel implementation taking a similar approach has trouble. Sincerely, Kumar On Fri, Feb 7, 2025 at 1:41 PM Dirk Eddelbuettel <e...@debian.org> wrote: > > Hi Kumar, > > From a quick look you borrow the 'Worker' object from RcppParallel. But > where > (as far as I recall) all posted examples of RcppParallel do _not_ put any R > objects inside a Worker instance, you put some there. That violates the > recommendation in Writing R Extensions. So I think the outcome you observe > is > as expected. > > Best, Dirk > > -- > dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org >
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel