Re: [Rd] Interrupting C++ code execution

From: Andrew Runnalls <A.R.Runnalls_at_kent.ac.uk>
Date: Thu, 28 Apr 2011 13:55:44 +0100

Peter,

On 25/04/11 10:22, schattenpflanze_at_arcor.de wrote:
> 1. Calling R_CheckUserInterrupt() interrupts immediately, so I have no
> possibility to exit my code gracefully. In particular, I suppose that
> objects created on the heap (e.g., STL containers) are not destructed
> properly.

Sorry not to have seen this thread sooner.

You may like to give CXXR a try
(
http://www.cs.kent.ac.uk/projects/cxxr/). In CXXR the R interpreter is written in C++, and a user interrupt is handled by throwing a C++ exception, so the stack is unwound in an orderly fashion, destructors are invoked, etc.

However, it's fair to say that in using CXXR with a multi-threaded program you'll be on the bleeding edge...

Andrew



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 28 Apr 2011 - 12:58:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 28 Apr 2011 - 14:30:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive