Integrating support for undo with exception handling

Avraham Shinnar, David Tarditi, Mark Plesko, and Bjarne Steensgaard.

Abstract
One of the important tasks of exception handling is to restore program state and invariants. Studies suggest that this is often done incorrectly. We introduce a new language construct that integrates automated memory recovery with exception handling. When an exception occurs, memory can be automatically restored to its previous state. We also provide a mechanism for applications to extend the automatic recovery mechanism with callbacks for restoring the state of external resources. We describe a logging-based implementation and evaluate its effect on performance. The implementation imposes no overhead on parts of the code that do not make use of this feature.
Full Paper
The full paper is available as a PDF.
Citation
Bibtex Citation
@techreport{shinnar:integrating,
  author = "Avraham Shinnar and David Tarditi and Mark Plesko and Bjarne Steensgaard",
  title = "Integrating support for undo with exception handling", 
  institution = "Microsoft Research",
  number = "MSR-TR-2004-140",
  month = dec,
  year = 2004,
}
MSR Link
It is Microsoft Research Technical Report MSR-TR-2004-140.