Completion Callback

Oct 14, 2014 at 7:38 PM
Hello!

It seems that R.NET's calculations run in its own process... is there some sort of completion callback I can use to notify my application when R calculations complete?
Developer
Oct 14, 2014 at 9:51 PM
R.NET is designed to work in-process; this includes R running in the same process as the C# code calling R.NET directly. So I do not understand what you mean by "in its own process". The method REngine.Evaluate returning signals the completion of an R statement.
I have had to use callbacks when launching threads from a UI to keep the UI responsive; is this what you mean? the callback mechanism to use would be no different from a thread not using R.NET.

Note that multiple threads accessing R concurrently is strongly not advised (unless there is a mutex, which probably defeats the purpose of multi-threading)

hope this helps.
Oct 14, 2014 at 11:08 PM
I would add that the R engine itself is single threaded, so all normal R calls for symbolic expression creation, evaluation, and output are single threaded and block until completion.