Here is the link for my threads question:
Yes only at startup is the problem whereas with openmp a specific number of threads depending on how long the loop is. Example, if the loop if only 100 elements it does not make really sense to have 10 threads working on it.
Regarding CxxWrap, I haven’t manage to make it work. Here is the link to my question:
Answering @DNF while I am at it. You do not need Rcpp to wrap C or C++ in R. R is not slow except if you write code like you do in C which nobody does. What is nice with Rcpp is that it creates an amazing bridge between R and C++. It gives you access to a lot of libraries like Boost, Armadillo, Eigen, QuantLib, intel threading building block…etc and this just by “decorating” your c++ file. It takes care of the linking and building for you. Instead of wasting your time focusing on coding you can actually focus on solving a given problem that has not been solved before.
Wrapping C++ is not only useful, it is key. I personnaly have no time to spend re-writting C/C++ code in Julia or re-inventing the wheel, not to mention the headache testing and maintaining it when I can leverage on what has been done by other over the years. There are things even Julia rely on which are written in C/C++ and I can bet that these are are not going anywhere like llvm and curl. Whether I like or not these C/C++ language have been around before I was born and I believe will still be around after my death…
@tkf , below is my question on discourse. Thank you for letting me know it is not possible.