"Jim Jewett" <[EMAIL PROTECTED]> writes:
> I do think we should split __del__ into the (rare, problematic)
> general case and a "special-purpose" lightweight __close__ version
> that does a better job in the normal case.
A synchronous finalizer which doesn't keep object it refers to alive,
like Python's __del__, is sufficient when the finalizer doesn't use
other finalizable objects, and doesn't conflict with the rest of the
program in terms of potentially concurrent operations on shared data
(read/write or write/write).
Note that the concurrency conflict can manifest even in a
single-threaded program, because __del__ finalizers are in fact
semi-asynchronous: they are invoked when a reference count is
decremented and causes the relevant object to become dead, which
can happen in lots of places, even on a seemingly innocent variable
assignment.
--
__("< Marcin Kowalczyk
\__/ [EMAIL PROTECTED]
^^ http://qrnik.knm.org.pl/~qrczak/
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com