<div dir="auto">Thank you very much for the clear answers, Dirk! They greatly help! </div><div dir="auto"><br></div><div dir="auto">Cheers, </div><div dir="auto">Kumar </div><div dir="auto"><br></div><div dir="auto"><br><div class="gmail_quote gmail_quote_container" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, Feb 8, 2025 at 1:17 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 7 February 2025 at 14:01, Kumar MS wrote:<br>
| Thank you Dirk. Your observation is correct. I am left with two questions. As<br>
| always, I appreciate your answers.<br>
| <br>
| 1. Except for this single step of calling an R function (model matrix-like<br>
| objects that are being created by an external library in R), all my other<br>
| computations are now implemented in C++ & thread friendly. Does this mean I<br>
| would have no other option but to go serial if I need to call R an function? Do<br>
| you have any alternative recommendations? I would really love to take advantage<br>
| of RcppParallel/TBB here, as I have heavily exploited RcppParallel to<br>
| parallelize everything else. <br>
<br>
Not to ruin your day (again) as I believe we have been over this a few times<br>
between here and your StackOverflow questions: Nomatter how much you want it<br>
to be possible you still cannot call back to R from the parallel code.<br>
<br>
| 2. Your RInside calculations in the Boost thread example are multi-threaded,<br>
| with a locking interface to RInside instance too. I wonder what makes that work<br>
| well without R reporting issues, while the TBB/rcppParallel implementation<br>
| taking a similar approach has trouble. <br>
<br>
RInside is not really a relevant example as it operates the other way around<br>
where you have a `main()` function and want to embed R. What we do with Rcpp<br>
is typically a running R process from which we call extensions. Not the same.<br>
<br>
Dirk<br>
<br>
-- <br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div></div>