Barry Warsaw <[EMAIL PROTECTED]> writes:
> What worries me is the unpredictability of gc vs. refcounting. For
> some class of Python applications it's important that when an object
> is dereferenced it really goes away right then. I /like/ reference
> counting!
This can be solved by explicit freeing of objects whose cleanup must
be performed deterministically.
Lisp has UNWIND-PROTECT and type-specific macros like WITH-OPEN-FILE.
C# has 'using' keyword. Python has 'with' which can be used for that.
Reference counting is inefficient, doesn't by itself handle cycles,
and is impractical to combine with threads which run in parallel. The
general consensus of modern language implementations is that a tracing
GC is the future.
I admit that implementing a good GC is hard. It's quite hard to make
it incremental, and it's hard to avoid stopping all threads during GC
(but it's easier to allow threads to run in parallel between GCs, with
no need of forced synchronization each time a reference to an object
is created).
--
__("< 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