Back to results
US 7,610,579 B2Granted
Critical finalizers
AssigneeMicrosoft Corporation
InventorsSean E. Trowbridge, Brian M. Grunkemeyer, Christopher W. Brumme, Mahesh Prakriya, Patrick H. Dussud, Ian H. Carmichael
Life of this patent
Estimating the term…
Abstract
A finalizer may include a notification that no tolerance for failure or corruption is expected. Any potential failure point, which may be induced by a runtime execution environment routine or subroutine that is associated with the finalizer may then be prepared apart from the finalizer.
Claims19
A method, comprising:
- identifying a class having prioritized finalization code, wherein the identifying includes receiving an indication that at least a sub-set of the finalization code expects to have no tolerance for failure;
- preparing the finalization code for an instance of the identified class, wherein the preparing includes:
- identifying a potential failure point associated with at least a portion of the finalization code;
- and
- hoisting the identified failure point to a designated execution location either preceding or following at least the portion of the finalization code;
- and
- executing the finalization code for the instance of the identified class.
4 more elements
A method, comprising:
- loading one or more classes, wherein the one or more classes include finalization attributes, wherein a finalization attribute of at least one of the one or more classes comprises a prioritized finalization attribute comprising a critical finalizer;
- preparing the critical finalizer, wherein the preparing includes:
- identifying a potential failure point associated with at least a portion of the critical finalizer;
- and
- hoisting the identified failure point to a designated execution location either preceding or following at least the portion of the critical finalizer;
- sorting the loaded classes based on respective finalization attributes, wherein the sorting includes sorting loaded classes having a prioritized finalization attribute from loaded classes having a non-prioritized finalization attribute;
- and
- finalizing objects of the loaded classes in an order based on the sorting, wherein the finalizing includes performing a garbage collection sweep on objects of the loaded classes, running a finalizer for objects with the non-prioritized finalization attribute before objects having a prioritized finalization attribute.
5 more elements
A method, comprising:
- sorting classes having a non-prioritized finalization attribute and classes having a prioritized finalization attribute;
- preparing a finalizer for a sorted class having a prioritized finalization attribute, wherein preparing the finalizer includes:
- identifying a potential failure point associated with at least a portion of the finalizer;
- and
- hoisting the identified failure point to a designated execution location either preceding or following at least the portion of the finalizer;
- finalizing a first constructed object for a sorted class having the non-prioritized finalization attribute;
- and
- finalizing a second constructed object for a sorted class having the prioritized finalization attribute, wherein the finalizing of the first constructed object occurs before the finalizing of the second constructed object.
5 more elements
A computer-readable storage medium having one or more executable instructions that, when read, cause one or more processors to:
- prepare a first finalizer for a class having a first attribute, wherein the first attribute is a critical finalizable attribute, wherein preparing the first finalizer includes:
- identifying a potential failure point associated with at least a portion of the first finalizer;
- and
- hoisting the identified failure point to a designated execution location either preceding or following at least the portion of the first finalizer;
- execute a second finalizer for an object of a class having a second attribute, wherein the second attribute is a non-critical finalizable attribute;
- and
- execute the first finalizer for an object of the class having the first attribute, wherein the first attribute indicates that the first finalizer for the class having the first attribute is to be executed after execution of the second finalizer for an object of a class having the second attribute.
4 more elements
A system, comprising:
- means for identifying a class having prioritized finalization code and a prioritized finalization attribute;
- means for preparing the prioritized finalization code for an object constructed from the identified class, wherein the means for preparing includes:
- means for identifying a potential failure point associated with at least a portion of the prioritized finalization code;
- and
- means for hoisting the identified failure point to a designated execution location either preceding or following at least the portion of the prioritized finalization code;
- and
- means for executing the prioritized finalization code for the constructed object,
- wherein the means for identifying determines that at least a portion of the prioritized finalization code expects to be executed after execution of finalization code for an object of a class having a non-prioritized finalization attribute.
5 more elements
Dependencies are inferred from the claim text.