#11521: Use weak references to cache homsets
--------------------------------------------------+-------------------------
Reporter: jpflori | Owner: robertwb
Type: defect | Status:
positive_review
Priority: major | Milestone: sage-5.4
Component: coercion | Resolution:
Keywords: sd35 | Work issues:
Report Upstream: N/A | Reviewers: Jean-Pierre
Flori, Nils Bruin
Authors: Simon King | Merged in:
Dependencies: #12969; to be merged with #715 | Stopgaps:
--------------------------------------------------+-------------------------
Comment (by jpflori):
You definitely already had a look at #12313, sorry about that.
Trying to summarize the action of the different coercion patches, here is
what I remember:
* in #715, see http://trac.sagemath.org/sage_trac/ticket/715#comment:75
and http://trac.sagemath.org/sage_trac/ticket/715#comment:86
* we now store weakref to the set acted upon in Actions.
* parents use a TripleDict for _action_hash where the Actions they
implement are stored with a strong ref.
* there is another TripleDict _action_maps in the coercion model with a
strong ref as well.
* so if a parent acted upon dies, it will only be weakrefed in the Action
itself and in the TripleDicts so that it will get garbage collected with
the Action as well, but as long as both of them are alive, there should be
no garbage collection.
* but then #12313 comes in because we also have a global cache for homset
which prevented parents to die. So only there the tripl dicts store
weakrefs to Action to enable gc back again. (just saw you just posted...)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11521#comment:156>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.