Interrupts (was Re: [Rd] X11 protocol errors ...)

Jan de Leeuw deleeuw@stat.ucla.edu
Thu, 23 Aug 2001 08:40:53 -0700


You can get the macros from "C Interfaces and Implementations" by
David Hanson, Chapter 4. He has some references to other C work
by Eric Roberts and Steve Maguire on this.

On Thursday, August 23, 2001, at 05:16 AM, Duncan Murdoch wrote:

> On Wed, 22 Aug 2001 19:32:51 -0500, you wrote:
>> I'm surprised we don't get more of these sorts of things on UNIX.  Our
>> current UNIX interrupt handling approach takes an immediate LONGJMP
>> out of the signal handler no matter where the signal occurs (except
>> for two places where signals are suspended).  Any place where an
>> invariant is temporarily broken, any place where an assignment is not
>> yet complete, is a potential trouble spot.
>
> Delphi protects against these kind of errors with "try ... except ..."
> and "try ... finally ..." blocks to deal with exceptions.  The first
> one executes special code if an exception occurs, the second
> guarantees execution of cleanup code.
>
> These are implemented as a linked list of records on the stack which
> the exception handler knows how to interpret.  When a particular kind
> of exception occurs, all "finally" blocks are executed in the
> appropriate order (and the stack base pointer is moved to simulate
> exits from all active routines) until an "except" block handling the
> particular kind of exception is reached.
>
> C doesn't have these statements built in, but presumably someone has
> written macros to do the same sort of thing.  Adding them would be a
> lot of work, but would be worthwhile.
>
> Duncan Murdoch
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> .-.-.-
> r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-
> FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-devel-
> request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> ._._._
>

===
Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
US mail: 9432 Boulter Hall, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw@stat.ucla.edu
homepage: http://www.stat.ucla.edu/~deleeuw
========================================================
           No matter where you go, there you are. --- Buckaroo Banzai
                    http://www.stat.ucla.edu/~deleeuw/sounds/nomatter.au
========================================================
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._