Bazaar on IronPython
Stephen J. Turnbull
stephen at xemacs.org
Tue Jun 30 01:10:49 BST 2009
Martin (gzlist) writes:
> Just so we're all on the same page with the terminology, that's
> relying on the refcounting to close the file, not the GC.
I don't understand the point of this distinction. Refcounting is one
of the standard algorithms for GC (with the well-known defect that
reference cycles never get collected). AIUI, for the purpose of this
discussion the point is that we have come to expect timely
finalization of open file handles. That happens to occur in the
CPython case because of file handles are refcounted *and* a refcount
of 0 triggers immediate finalization, but that is not essential.
Refcounting is neither necessary nor sufficient for early finalization
of file handles by GC.
All that matters here is that early finalization of file handles is an
empirical fact of the CPython GC implementation that we can't expect
in other GC schemes.
More information about the bazaar
mailing list