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

Re: exception systems

|   Date: Thu, 18 Apr 1996 15:12:31 -0400
|   From: Matthias Blume <blume@cs.Princeton.EDU>

|   > 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).

There is still a procedure call, namely that to the receiver of the

In addition, perhaps VSCM and ML don't do this, but cwcc requires some
additional context saving on top of whatever overhead the actual
"stack" requires to preserve:

- interrupt blocking mask
- dynamic wind context
- Occasional additional state (there is some additional stuff in MIT
  Scheme having to do with debugging, but it is very minimal).

None of this state needs to be reified or collected until the point
when you actually need the continuation.  Having a mechanism that
forces you to capture it earlier adds unnecessary overhead to the
really cheap (and frequent) interrupt handlers.