[Rcpp-devel] Interrupts in compiled code.

Dirk Eddelbuettel edd at debian.org
Thu Dec 9 00:38:22 CET 2010


On 8 December 2010 at 16:27, Andrew Redd wrote:
| Thanks for pointing that out.  I don't pretend to understand the reasons but
| that method seems to be much more responsive than the throw/catch method.  It
| seems like the throw catch should be just as efficient, and should add very
| little overhead.  It does not add overhead, but the R_CheckUserInterupt also
| does not appear to add significant overhead either.  The throw method seems to
| take a very long time between when the interrupt is sent before the error is
| caught.   Is there a way to speed up the throw/catch?

This may be a case of "you can't have your cake and eat it".  

At some point we need to run the finalizers etc to clean up after ourselves.
That has (some) cost.  R_CheckUserInterrupt() may be a valid alternative,
and/or it may lead to memory leaks and what have you.  

What I use showed you was usage as per the design. It's what I would use.

Cheers, Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list