<HTML>
<HEAD>
<TITLE>Thread handling</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi, <BR>
I&#8217;ve finally got a working start to using Rcpp to interface with some of my c++ code, and now I have a practical question about the interface. My first task was simply to launch algorithms from R, and thanks to a lot of help from this community, I finally got that task solved. Now, however, I lose all response from R as soon as I launch many long and intensive algorithms. That isn&#8217;t to say it isn&#8217;t working, and the responsiveness comes back after the jobs eventually finish. Ideally, I would like to let my users continue to use R while their jobs run, and I can handle that in c++ with threads. However, I also want to let my users know when their jobs finish. Ordinarily I would register some sort of callback function in one of my own programs to alert a user when a threaded task finishes. However, I don&#8217;t know enough about R to know how to send a message to a user, especially from external code that has been called. As is, I&#8217;m able to return an argument such as a SEXP value from my function, and I can have it give feedback. However, if I do that before the thread finishes, I don&#8217;t know if there is a way to access it any more after the thread finishes. Likewise, if I were to wait until the thread finishes, then I might as well not call a thread. So what would be recommended as an Rcpp suggested mechanism for alerting users in R as to when threaded jobs finish?<BR>
Thanks,<BR>
Sean &nbsp;</SPAN></FONT>
</BODY>
</HTML>