Re: garbage collection / cyclic references

2009-03-22 Thread Aaron Brady
On Mar 21, 11:59 am, andrew cooke and...@acooke.org wrote: Aaron Brady wrote: My point is, that garbage collection is able to detect when there are no program-reachable references to an object.  Why not notify the programmer (the programmer's objects) when that happens?  If the object

Re: garbage collection / cyclic references

2009-03-21 Thread Paul Rubin
andrew cooke and...@acooke.org writes: the two dominant virtual machines - .net and the jvm both handle circular references with no problem whatever. AFAIK, they also don't guarantee that finalizers ever run, much less run in deterministic order. --

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 20, 8:12 pm, andrew cooke and...@acooke.org wrote: Aaron Brady wrote: [...] caveats and fragilities?  If free software can do it, why isn't it all over the industry?  What disqualifies it from solved-problem status? the two dominant virtual machines - .net and the jvm both handle

Re: garbage collection / cyclic references

2009-03-21 Thread Martin v. Löwis
The actual backend of CPython requires garbage-collected container types to implement tp_inquiry and tp_clear methods, but user-defined types apparently aren't required to conform. tp_inquiry doesn't exist, you probably mean tp_traverse. tp_traverse is completely irrelevant for python-defined

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
Paul Rubin wrote: andrew cooke and...@acooke.org writes: the two dominant virtual machines - .net and the jvm both handle circular references with no problem whatever. AFAIK, they also don't guarantee that finalizers ever run, much less run in deterministic order. i think you're right, but

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 7:54 am, andrew cooke and...@acooke.org wrote: Paul Rubin wrote: andrew cooke and...@acooke.org writes: the two dominant virtual machines - .net and the jvm both handle circular references with no problem whatever. AFAIK, they also don't guarantee that finalizers ever run,

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
Aaron Brady wrote: On Mar 21, 7:54 am, andrew cooke and...@acooke.org wrote: they should not be used to do things like flushing and closing files, for example. What is your basis for this claim, if it's not the mere unreliability of finalization? IOW, are you not merely begging the question?

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
andrew cooke wrote: Aaron Brady wrote: On Mar 21, 7:54 am, andrew cooke and...@acooke.org wrote: they should not be used to do things like flushing and closing files, for example. What is your basis for this claim, if it's not the mere unreliability of finalization? IOW, are you not merely

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 9:50 am, andrew cooke and...@acooke.org wrote: Aaron Brady wrote: On Mar 21, 7:54 am, andrew cooke and...@acooke.org wrote: they should not be used to do things like flushing and closing files, for example. What is your basis for this claim, if it's not the mere unreliability

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 10:28 am, Aaron Brady castiro...@gmail.com wrote: On Mar 21, 9:50 am, andrew cooke and...@acooke.org wrote: Aaron Brady wrote: On Mar 21, 7:54 am, andrew cooke and...@acooke.org wrote: they should not be used to do things like flushing and closing files, for example.

Re: garbage collection / cyclic references

2009-03-21 Thread andrew cooke
Aaron Brady wrote: My point is, that garbage collection is able to detect when there are no program-reachable references to an object. Why not notify the programmer (the programmer's objects) when that happens? If the object does still have other unreachable references, s/he should be

Re: garbage collection / cyclic references

2009-03-21 Thread John Nagle
Aaron Brady wrote: Hello, I was reading and Googling about garbage collection, reference counting, and the problem of cyclic references. Python's garbage collection module claims to be able to detect and break cyclic garbage. Some other languages merely prohibit it. Is this the place to ask

Re: garbage collection / cyclic references

2009-03-21 Thread Aaron Brady
On Mar 21, 1:04 pm, John Nagle na...@animats.com wrote: Aaron Brady wrote: Hello, I was reading and Googling about garbage collection, reference counting, and the problem of cyclic references. Python's garbage collection module claims to be able to detect and break cyclic garbage.  

garbage collection / cyclic references

2009-03-20 Thread Aaron Brady
Hello, I was reading and Googling about garbage collection, reference counting, and the problem of cyclic references. Python's garbage collection module claims to be able to detect and break cyclic garbage. Some other languages merely prohibit it. Is this the place to ask about its technique?

Re: garbage collection / cyclic references

2009-03-20 Thread andrew cooke
Aaron Brady wrote: [...] caveats and fragilities? If free software can do it, why isn't it all over the industry? What disqualifies it from solved-problem status? the two dominant virtual machines - .net and the jvm both handle circular references with no problem whatever. this is standard