Article View: comp.std.c++
Article #1993Re: Why aren't there not-necessarily-unwinding
From: Steve Clamage
Date: Wed, 20 Sep 1995 03:31
Date: Wed, 20 Sep 1995 03:31
43 lines
2713 bytes
2713 bytes
In article 95Sep19103925@physics3.Berkeley.EDU, "Daniel S. Barclay" <daniel@compass-da.com> writes: > >In the design of exceptions and exception handling, has the language >design committee (or implementors or whoever) reviewed VAX/VMS exception >handling and its capabilities? > >I've noticed one thing that the C++ draft's exception mechanism does not >(seem to) support that VAX/VMS supports (or at least used to; I haven't used >VMS for 6 years). > >In VMS exception handling, the stack is not unwound before traversing upwards >to find the applicable exception handler. The handler gets control first, >and can decide whether to unwind and handle the exception, to pass control up >to the next handler, or to continue execution of the code that raised (threw) >the exception. That is usually referred to as "resumeable exceptions", since you can elect to resume from the point of the exception as if nothing had happend. C++ exceptions are non-resumable; you always unwind up to the location of the exception handler. Whether to have resumeable or non-resumeable exceptions was debated EXTENSIVELY -- for about two years -- before it was settled. A vocal minority wanted resumeable exceptions. The clinching argument came from a presentation by Jim Mitchell, long a proponent of resumeable exceptions. He and his colleagues found over time that resumeable exceptions hardly ever were useful; code that had used them tended over time to be modified so as not to use the resume option. He came to the point of reversing his stance. In addition, allowing exceptions to be resumed forces a lot of overhead on all programs that use exceptions, even if they do not want to resume them. Non- resumeable exceptions do not require much overhead. Furthermore, you can simulate resumeable exceptions (although not as conveniently) if you want the capability. It's more work for the programmer, but only programs that want to resume exceptions have to pay the price. --- Steve Clamage, stephen.clamage@eng.sun.com --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<43n9pq$b1c@engnews2.Eng.Sun.COM>Path:
arc1-ca.pugleaf.net!in1.uu.net!bounce-backReferences:
<MATT.95Sep19103925@physics3.Berkeley.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back Date: 20 Sep 95 03:31:00 GMT Approved: fjh@cs.mu.oz.au From: clamage@Eng.Sun.COM (Steve Clamage) Newsgroups: comp.std.c++ Subject: Re: Why aren't there not-necessarily-unwinding X-Original-Date: 19 Sep 1995 20:39:22 GMT Organization: Sun Microsystems Inc. Message-ID: <43n9pq$b1c@engnews2.Eng.Sun.COM> References: <MATT.95Sep19103925@physics3.Berkeley.EDU> Reply-To: clamage@Eng.Sun.COM