R instantiation when called from c++
I am using Rcpp and RInside, to interconnect my 开发者_JAVA百科R based code to c++. I make multiple distinct calls to R from c++. I wanted to know if each call to R, creates a new instance of R ?
The reason I want to know this is cos I want to optimize my c++ code, by pre-computing stuff, etc. But I don't know how the calls are internally handled ?
Thnx
-egon.
As R is single-threaded, there is precisely one instance. It is stateful. You create it once at startup, and do whichever inits you need to make.
精彩评论