Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

New Post: Restart engine

$
0
0
No, it is not impossible.

But I don't understand your problem. If every user wants to use R, then why not simply use the same R session to handle all their requests? If your code base in R need a new session for each request, that suggests a more immediate problem.

Hacky work arounds are still possible. A basic challenge is that due to how R is setup, bad code in it can "take down" an entire process (i.e. your C# application). The most robust work around is to start R in a separate process, and run your code through an interface layer that does interprocess communication. This way if R dies, you can catch it on the C# side, and just kick off another process, R won't be able to disrupt your C# code. Of course the new version might die to, so you might repeatedly be hacking around a problem in R.

This is how the F# R type provider does things though. It creates a new process it communicates with to process R requests, and it is reasonably robust.

So two questions: 1 - are you loading the R runtime in the same process and 2 - Why do all R calls require independent processes?

Viewing all articles
Browse latest Browse all 1634

Trending Articles