Object reference counting



I think the answer is no, but is there any way for me to know how many Objects reference a given Object?

The given object contains a reference to a disk file, and I'd like to delete the file when there are no more threads that reference the Object. In other words, when the Object is available for garbage collection, I want to get rid of the file.

I think finalizers were intended for this purpose, but there is quite a bit out there on why using finalizers is a bad idea.
.



Relevant Pages

  • Re: Why dont people like lisp?
    ... "Rainer Deyke" writes: ... > Joe Marshall wrote: ... > last reference to the file is gone. ... Common Lisp as currently formulated does not have finalizers, ...
    (comp.lang.python)
  • Re: Why dont people like lisp?
    ... "Rainer Deyke" writes: ... > Joe Marshall wrote: ... > last reference to the file is gone. ... Common Lisp as currently formulated does not have finalizers, ...
    (comp.lang.lisp)
  • Re: Object reference counting
    ... Objects reference a given Object? ... bit out there on why using finalizers is a bad idea. ... There is no guarantee that an object will be freed, ... no guarantee that its finalizer method will be called, ...
    (comp.lang.java.programmer)
  • Re: Garbage collection
    ... If it is called then is may be either immediately the last reference ... or it may be later when the garbage collector ... Java finalizers are not called upon VM exit, ... uses the CLR which has its own peculiarities: ...
    (comp.lang.python)
  • Re: Memory Allocation in Lisp?
    ... Paul Wallich wrote: ... > is that nothing in the live part of the system contains a reference to it. ... Though if you dip into implementation internals you may be able to ... Also, some implementations provide finalizers, so you can do something ...
    (comp.lang.lisp)