[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exception systems



From: "Guillermo J. Rozas" <gjr@martigny.ai.mit.edu>
Subject: Re: exception systems
Date: Thu, 18 Apr 96 14:59:40 -0400

> |   Cc: shivers@ai.mit.edu, will@ccs.neu.edu, rrrs-authors@mc.lcs.mit.edu,
> |	   kmp@harlequin.com
> |   References: <9604181347.aa04504@mc.lcs.mit.edu>
> |   X-Mailer: Mew version 1.03 on Emacs 19.28.1
> |   Mime-Version: 1.0
> |   Content-Type: Text/Plain; charset=us-ascii
> |   Date: Thu, 18 Apr 1996 14:52:10 -0400
> |   From: Matthias Blume <blume@CS.Princeton.EDU>
> |
> |   It would perhaps be a good idea to look at John Reppy's interrupt
> |   handling mechanism for SML/NJ.  It is based on continuations.  This
> |   way one can easily build context-switch on top of it (which is what he
> |   needed it for -- because he wanted to use it for CML), but it is
> |   almost trivial to write a signal handler that raises an exception
> |   should this be the desired effect.
> |
> |   Of course, for all this to work efficiently one needs a very efficient
> |   implementation of call/cc.
> 
> I don't think that cwcc is necessary at all in a basic interrupt
> handling feature.

Right.

> In MIT Scheme, interrupts just "push a new frame".  The interrupt
> handler can then decide whether it wants to use cwcc or do something
> else.

I can't say I haven't heard of such an approach: VSCM does the same thing.

> In essence I view the bottom-level of interrupt and exception handling
> as a procedure call not visible in the code of the interrupted routine.
> It should require no more overhead than this.

I was actually thinking of *less* overhead than that.  With a
call/cc-based mechanism you get the context switch for free (and
SML/NJ's call/cc mechanism is *very* fast!).  If you use your model,
then you always get the procedure call, and on top of that there will
be the call/cc (as part of the handler's code).

-Matthias