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

Re: exception systems

    I think floating point traps and interrupts are both important
    sources of exceptions.  I agreed with your analysis of asynchronous
    interrupts, but I draw an opposite conclusion:  Your analysis shows
    that proper handling of asynchronous interrupts presupposes an
    adequate exception system.

    I mentioned asynchronous interrupts to warn against thinking of
    exceptions as uncommon events.  MacScheme was designed to handle
    about 10 timer exceptions per second, and often handles about 30
    per second in practice.  Nowadays it would be more reasonable to
    handle well over a hundred timer exceptions as a matter of course
    (faster than the eye can see), and to handle well over a thousand
    exceptions per second when profiling, without any noticeable
    degradation in performance.

I would like to take a stand against referring to async interrupts as
exceptions.  I'd like to retain the word "exceptions" as meaning something
synchronous -- the result of something my program did at a particular point,
e.g. "I added those two numbers together and it blew up on me." Not something
that could be caused by an external agent, completely independent of what my
program was doing.

(Synchronous) Exceptions are just extra edges in your control-flow
graph. Asynchronous signals are a communications mechanism between concurrent
agents (in Unix, processes). The machinery appropriate for these two types of
thing is not the same.

I hate the fact that Unix confounds these two concepts, and would like to
avoid doing it in Scheme.