#13394: Write a WeakValueDictionary with safer key removal
-------------------------------------+-------------------------------------
Reporter: nbruin | Owner: rlm
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-5.13
Component: memleak | Resolution:
Keywords: | Merged in:
Authors: Simon King, Nils | Reviewers: Nils Bruin, Simon
Bruin | King
Report Upstream: None of the above | Work issues:
- read trac for reasoning. | Commit:
Branch: | 11bd210662b7dfa8eea2a6ff258980663ae14209
u/SimonKing/ticket/13394 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Description changed by jdemeyer:
Old description:
> On ticket #12313 we found that the use of `WeakValueDictionaries` as
> caches can cause `removal` callbacks in rather harsh environments. Normal
> `WeakValueDictionaries` remove keys with dead values by looking up the
> key. This involves Python equality testing on the key, which can cause
> any kind of operation in Sage. We need a dictionary where we can delete
> entries without key comparisons. See below for possible strategies.
>
> '''To the release manager:'''
>
> There is quite a bit of back-and-forth in the history of this branch that
> is not very instructive to have in the global history of sage. Hence, we
> have provided a single patch, if that seems to suite better. Moreover, it
> is in the old folder layout, so that it should be possible to apply
> before
>
> Apply [attachment:trac13394-weak_value_dictionary.patch]
New description:
On ticket #12313 we found that the use of `WeakValueDictionaries` as
caches can cause `removal` callbacks in rather harsh environments. Normal
`WeakValueDictionaries` remove keys with dead values by looking up the
key. This involves Python equality testing on the key, which can cause any
kind of operation in Sage. We need a dictionary where we can delete
entries without key comparisons. See below for possible strategies.
'''To the release manager:'''
Apply [attachment:trac13394-weak_value_dictionary.patch]
--
--
Ticket URL: <http://trac.sagemath.org/ticket/13394#comment:101>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.