#5843: race condition in cached_method (should not be shared between instances)
------------------------+---------------------------------------------------
Reporter: nthiery | Owner: mhansen
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-4.3.1
Component: misc | Keywords: race condition, cached_method, cache
Work_issues: | Author:
Upstream: N/A | Reviewer:
Merged: |
------------------------+---------------------------------------------------
Changes (by wjp):
* status: new => needs_review
* upstream: => N/A
Comment:
I added a patch that returns a (newly created) {{{CachedMethodCaller}}}
object from {{{CachedMethod.__get__}}} that stores the instance on which
the {{{CachedMethod}}} was called.
Additionally this object has a {{{__get__}}} of its own that does the same
to handle stored copies of {{{CachedMethodCaller}}}s, which is something
that categories seem to do.
Using a function/closure would also handle the caching (and I added a
comment in the patch on how to do it exactly), but you would lose the
ability to call methods like {{{is_in_cache()}}} which are used in some
places in sage.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5843#comment:2>
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.