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

Call Future cancellation in the object finalizer #17

Open
DragonFrai opened this issue Sep 17, 2023 · 0 comments
Open

Call Future cancellation in the object finalizer #17

DragonFrai opened this issue Sep 17, 2023 · 0 comments
Labels
futures Assigned with futures module

Comments

@DragonFrai
Copy link
Owner

DragonFrai commented Sep 17, 2023

Problem

The absence of a Drop call for non-terminal futures can lead to memory leaks or infinite waiting for mutexes and other synchronization primitives in case of an exception.

Solution

Call Future cancellation in the object finalizer and suppress the finalization when completed correctly

Alternatives

Do nothing.
The low-level implementation of Future is responsible for the correct Drop call, and the user should not be able to cause these errors by any of his actions.
Exceptions are the explicit acquisition of resources similar to locks, as in Mutex.

@DragonFrai DragonFrai added the futures Assigned with futures module label Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
futures Assigned with futures module
Projects
None yet
Development

No branches or pull requests

1 participant