#14159: Don't install callbacks on values of TripleDict, MonoDict
------------------------------+---------------------------------------------
       Reporter:  nbruin      |         Owner:  tbd         
           Type:  defect      |        Status:  needs_review
       Priority:  major       |     Milestone:  sage-5.8    
      Component:  memleak     |    Resolution:              
       Keywords:              |   Work issues:              
Report Upstream:  N/A         |     Reviewers:  Nils Bruin  
        Authors:  Simon King  |     Merged in:              
   Dependencies:  #13387      |      Stopgaps:              
------------------------------+---------------------------------------------

Comment (by nbruin):

 tests OK for me. One tiny nitpick:
  - You're claiming that this fixes an extremely rare race condition wrt.
 to GC. I'm actually not sure that it CAN occur for our particular use
 (because our value has a strong reference to a key component). I think
 your example on `TripleDictEraserOnValue` illustrates why we should prefer
 checking this anyway. I hope we don't have to be this paranoid in the
 future.

 There's another one, that the `_cache[X,Y,category]=KeyedRef(...)`
 statement is very fragile: If you make a mistake in typing the
 `(id(X),id(Y),id(category))` you'll have a very hard to trace (and
 possibly disastrous!) bug in your program. One solution would be to
 encapsulate it in `TripleDict`, but the instantiation of the
 `TripleDictEraserOnValue` would complicate the logic in `TripleDict`,
 so let's just keep it this way.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14159#comment:19>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to