cPython, IronPython, Jython, and PyPy (Oh my!)

Tim Delaney timothy.c.delaney at gmail.com
Wed May 16 18:32:30 EDT 2012


On 17 May 2012 07:33, Ethan Furman <ethan at stoneleaf.us> wrote:

> Just hit a snag:
>
> In cPython the deterministic garbage collection allows me a particular
> optimization when retrieving records from a dbf file -- namely, by using
> weakrefs I can tell if the record is still in memory and active, and if so
> not hit the disk to get the data;  with PyPy (and probably the others) this
> doesn't work because the record may still be around even when it is no
> longer active because it hasn't been garbage collected yet.
>

What is the distinguishing feature of an "active" record? What is the
problem if you get back a reference to an inactive record? And if there is
indeed a problem, don't you already have a race condition on CPython?

1. Record is active;
2. Get reference to record through weak ref;
3. Record becomes inactive;
4. Start trying to use the (now inactive) record.

Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120517/fff536a2/attachment.html>


More information about the Python-list mailing list