[ZODB-Dev] [Enhancement Proposal] Garanteed lifetime for volatile
variables
Dieter Maurer
dieter at handshake.de
Mon Oct 9 14:44:59 EDT 2006
Jim Fulton wrote at 2006-10-9 13:22 -0400:
> ...
>Hm, I don't why the use cases imply setting it only at the class
>level, but OK. I'll just take that as a given. So, since _p_sticky
>is set at the class level, why store it on the instances?
Use case 2, set on class level;
use case 3, set on instance level.
To make cache garbage collection as fast as possible,
I have proposed to actually store the sticky information in the
C object structure. In the garbage collection loop,
this gives an "if (...obj->p_sticky...)" instead
of
isSticky = PyObject_GetAttr(obj, _p_sticky_name)
if (...isSticky...) {....}
Py_XDECREF(isSticky)
This part of the proposal (storing "_p_sticky" in the the
C header of persistent objects) is not essentail.
--
Dieter
More information about the ZODB-Dev
mailing list