[J3] Exception handling reference

Van Snyder van.snyder at jpl.nasa.gov
Tue Sep 4 02:41:26 EDT 2018


On Mon, 2018-09-03 at 23:22 -0600, William Clodius via J3 wrote:
> I thought about writing a paper on the semantics of exception handling, but decided against
> it. However my research did find some references. To me the most useful for J3 would be Herb 
> Sutter’s paper for SC22/WG21, "Zero-overhead deterministic exceptions: Throwing values”, 
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf an an alternative C++ 
> exception handling scheme that he hopes would have much lower overhead than  the current C++ 
> scheme. FWIW this paper has an extensive reference list that includes other papers/blogs that 
> I also found interesting.

I learned a few years ago from Randy Brukardt that the exception system
in the Janus Ada processor (the one he's responsible for) has, in his
words "very low overhead" unless an exception occurs.

He also told me that the exception system in the GNU Ada Translator has
no overhead unless an exception occurs.  Maybe it uses the method Sutter
described.  But it's quite a bit older than 2018, so maybe Robert Dewar
and his colleagues invented a different zero-overhead method.

There is no excuse to object to exception handling on performance
grounds.

BTW, if a multilanguage program that appears to the Fortran parts of it
to be C, are actually C++ or Ada, in our present condition, if they
throw an exception, it would skip over any intermediate Fortran parts,
and their finalizers wouldn't be run, and their allocatable and
automatic variables wouldn't be cleaned up.  There is a chance that a
Fortran exception system could be integrated with a companion
processor's exception system.




More information about the J3 mailing list