Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the guarantee that an implementation runs finalizers on exit. #309

Merged
merged 2 commits into from
May 5, 2021

Conversation

BillWagner
Copy link
Member

Fixes #176
Fixes #291

The normative text now declares that running finalizers on exit is implementation specific.

I added an additional note that the .NET Framework follows the earlier standard text. (I looked for a definitive statement on the Mono environment, and I found resources that implied both that it did and it didn't follow this guarantee.

I'll propose three resolutions in comments for committee members to consider.

Fixes dotnet#176
Fixes dotnet#291

The normative text now declares that running finalizers on exit is implementation specific.

I added an additional *note* that the .NET Framework follows the earlier standard text. (I looked for a definitive statement on the Mono environment, and I found resources that implied both that it did and it didn't follow this guarantee.
@BillWagner
Copy link
Member Author

Proposal 1:

Accept these changes as is.

@BillWagner
Copy link
Member Author

Proposal 2:

Accept the normative text change, but do not include the additional note.

@BillWagner
Copy link
Member Author

BillWagner commented May 4, 2021

Proposal 3:

Delete the original paragraph, but do not add any new text.

@BillWagner BillWagner added the meeting: discuss This issue should be discussed at the next TC49-TG2 meeting label May 5, 2021
standard/basic-concepts.md Outdated Show resolved Hide resolved
Co-authored-by: Jon Skeet <skeet@pobox.com>
Prior to an application's termination, an implementation should make every reasonable effort to call finalizers ([§15.13](classes.md#1513-finalizers)) for all of its objects that have not yet been garbage collected, unless such cleanup has been suppressed (by a call to the library method `GC.SuppressFinalize`, for example). The implementation should document any conditions under which this behavior cannot be guaranteed.
Whether or not finalizers ([§15.13](classes.md#1513-finalizers)) are run as part of application termination is implementation-specific.

> *Note*: The .NET Framework implementation makes every reasonable effort to call finalizers ([§15.13](classes.md#1513-finalizers)) for all of its objects that have not yet been garbage collected, unless such cleanup has been suppressed (by a call to the library method `GC.SuppressFinalize`, for example). No other implementation makes this guarantee. *end note*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> *Note*: The .NET Framework implementation makes every reasonable effort to call finalizers ([§15.13](classes.md#1513-finalizers)) for all of its objects that have not yet been garbage collected, unless such cleanup has been suppressed (by a call to the library method `GC.SuppressFinalize`, for example). No other implementation makes this guarantee. *end note*
> *Note*: The .NET Framework implementation makes every reasonable effort to call finalizers ([§15.13](classes.md#1513-finalizers)) for all of its objects that have not yet been garbage collected, unless such cleanup has been suppressed (by a call to the library method `GC.SuppressFinalize`, for example).*end note*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting: discuss This issue should be discussed at the next TC49-TG2 meeting
Projects
None yet
3 participants