[Rd] invoking R function in C++ in parallel

Gábor Csárdi csardi.gabor at gmail.com
Sun Feb 1 01:29:48 CET 2015

On Sat, Jan 31, 2015 at 7:05 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

> - either work in something like OpenMP and run in multiple threads that
>    remain /completely/ shielded from R, ie no R calls, and not even R data
>    types as you cannot trigger gc() calls from different threads

I think you can use R objects, as long as you don't call R functions on
them (not even from R's C api, although some of them are currently fine)
and consider them as read-only. E.g. if you have a numeric vector, you can
double *cvec = REAL(vec);
and then use cvec in your thread(s).

This is pretty restrictive, but could be enough in some cases.



	[[alternative HTML version deleted]]

More information about the R-devel mailing list