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

Re: Exception handling



at the physical point of interruption, typically several
instructions beyond the logical point (in systems without a precise
interrupt mode or capability), a stack frame may have been partially
unwound.

Preventing this type of uncertainty requires inserting synchronising
instructions (interrupt reflection barriers) at block-entry-and-exit
points


754R alternate exception handling is attached to a "block" which is
a language-defined syntax unit.    It would typically be a loop.
Having a synchronization instruction at the end, outside the loop,
would not seem to be a major cost.    Since alternate exception handling
is usually enabled staticly (from a language point of view), the compiler
knows just where to place those synchronizations.     

Perhaps the issue is subfunctions invoked within the block with alternate
exception handling attached.    E.1 says
"The syntax and scope for such mode declarations are language-defined."
Whether a subfunction is affected by alternate exception handling declared
by its invoker is language-defined  (precisely to not prejudice for or
against dynamic implementation mechanisms which might be inherited,
or functions expanded inline, or static separately-compiled implementations
which might not be inherited) and, in that light, including external
subfunctions in such a block would have to be carefully considered in
a portable program.

If putting synchronization instructions within inner loops were required,
that might seem expensive, 
but that would have to be compared to alternative costs of doing
an equivalent computation, not against the costs of doing some other computation
that fits a particular hardware scheme.     Perhaps the hardware schemes
will evolve to better fit the programming model.

Otherwise, what are the new issues with 754R throw excepName
are that aren't already faced in dealing with setjmp/longjmp and their ilk?
Somebody has to be prepared to receive a signal (which they were warned
in advance about) that might be generated many layers below (and the 
intermediate layers were unaware of the signal generation and reception).     
The stack
has to be unwound in some kind of orderly way appropriate to a particular
language programming model.

754 | revision | FAQ | references | list archive