Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Valid finalizer#532

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
dmitriyse wants to merge17 commits intopythonnet:masterfromdmitriyse:valid-finalizer
Closed

Conversation

dmitriyse
Copy link
Contributor

What does this implement/fix? Explain your changes.

Implements really working finalizers solution.
...

Does this close any currently open issues?

Probably some issues will be fixed.
...

Any other comments?

Current finalizers solution are totally not working. Probably interop calls are disallowed in the C# finalizers. Or Finalizer thread becomes broken after a few calls to ~PyObject.
...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself toAUTHORS
  • Updated theCHANGELOG

@mention-bot
Copy link

@dmitriyse, thanks!@vmuriart,@tonyroberts,@hsoft,@cgohlke and@tiran, please review this.

@codecov
Copy link

codecovbot commentedAug 28, 2017
edited
Loading

Codecov Report

Merging#532 intomaster willincrease coverage by0.03%.
The diff coverage is72.22%.

Impacted file tree graph

@@            Coverage Diff             @@##           master     #532      +/-   ##==========================================+ Coverage   76.99%   77.03%   +0.03%==========================================  Files          64       65       +1       Lines        5612     5747     +135       Branches      888      911      +23     ==========================================+ Hits         4321     4427     +106- Misses       1002     1016      +14- Partials      289      304      +15
FlagCoverage Δ
#setup_linux69.42% <ø> (ø)⬆️
#setup_windows76.23% <72.22%> (+0.05%)⬆️
Impacted FilesCoverage Δ
src/runtime/debughelper.cs0% <ø> (ø)⬆️
src/runtime/interop.cs95.71% <ø> (-0.03%)⬇️
src/runtime/runtime.cs91.6% <100%> (+0.62%)⬆️
src/runtime/classmanager.cs94.9% <100%> (+0.06%)⬆️
src/runtime/typemanager.cs84.16% <100%> (+0.13%)⬆️
src/runtime/classderived.cs88.41% <100%> (+0.07%)⬆️
src/runtime/methodbinding.cs80% <100%> (ø)⬆️
src/runtime/moduleobject.cs85% <100%> (-0.06%)⬇️
src/runtime/genericutil.cs86.36% <100%> (+0.42%)⬆️
src/runtime/assemblymanager.cs89.83% <100%> (+0.05%)⬆️
... and11 more

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatec18285f...5ffab45. Read thecomment docs.

@dmitriysedmitriyseforce-pushed thevalid-finalizer branch 10 times, most recently from0212233 tobfb6e59CompareAugust 29, 2017 16:19
…oduces bugs when CPython freeing up enough objects.
@dmitriysedmitriyseforce-pushed thevalid-finalizer branch 17 times, most recently frombe8154f to50fb157CompareSeptember 1, 2017 13:33
}
}
}
catch
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't is better to explicitly fail, instead of "bypassing" the exception handling with an emptycatch {}? What issue is this solving thatdisposed anddisposing flags are not taking care of?


namespace Python.Runtime
{
internal class PyReferenceDecrementer : IDisposable
Copy link
Contributor

Choose a reason for hiding this comment

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

please explain (in the comments) the purpose of PyReferenceDecrementer and what issues it addressed?

////Marshal.FreeHGlobal(_programName);
////_programName = IntPtr.Zero;
////Marshal.FreeHGlobal(_pythonPath);
////_pythonPath = IntPtr.Zero;
Copy link
Contributor

Choose a reason for hiding this comment

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

💯 👍

@@ -568,15 +602,24 @@ internal GILState()
state = PythonEngine.AcquireLock();
}

protected virtual void Dispose(bool disposing)
{
//ReleeaseLock is thread bound and if it's called in finalizer thread it can wrongly release lock.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo here

@den-run-ai
Copy link
Contributor

@dmitriyse@filmor i left some comments here, but I generally approve this pull request:

#532 (comment)
#532 (comment)
#532 (comment)

Copy link
Contributor

@den-run-aiden-run-ai left a comment

Choose a reason for hiding this comment

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

Please resolve merge conflicts

@dmitriysedmitriyse mentioned this pull requestJun 24, 2018
4 tasks
@den-run-ai
Copy link
Contributor

@dmitriyse can you please resolve one merge conflict? can you remind me the order of PRs? If I don't get any feedback from@filmor@vmuriart@yagweb, then I'm going review again and merge this within 2 weeks, when I plan to be on vacation.

@den-run-aiden-run-ai requested a review fromyagwebJune 24, 2018 19:54
@den-run-ai
Copy link
Contributor

@dmitriyse ok, i found this message from you, please let me know if this is still valid:

#532 also depends on#534, (which is only a bunch of general fixes).
#532 is a superset of#534. So#534 just helps to separate general fixes from finalizer changes.
#531 does not depends on anything.

@dmitriyse
Copy link
ContributorAuthor

I will answer some day latter. Sorry.

@filmorfilmor added this to the2.4.0 milestoneAug 30, 2018
@filmorfilmor mentioned this pull requestJan 18, 2019
@filmorfilmor removed this from the2.4.0 milestoneFeb 5, 2019
@filmorfilmor closed thisApr 1, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@den-run-aiden-run-aiden-run-ai requested changes

@filmorfilmorAwaiting requested review from filmor

@tonyrobertstonyrobertsAwaiting requested review from tonyroberts

@vmuriartvmuriartAwaiting requested review from vmuriart

@yagwebyagwebAwaiting requested review from yagweb

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@dmitriyse@mention-bot@den-run-ai@JanKrivanek@filmor

[8]ページ先頭

©2009-2025 Movatter.jp