fork()

Donn Cave donn at u.washington.edu
Mon Jun 14 10:58:55 EDT 1999


Hisao Suzuki <suzuki611 at okisoft.co.jp> writes:
...
| Such an action will break, say, an unreachable doubly-linked
| tree into separated nodes.  Then the nodes will be destroyed by
| a normal process including invocations of __del__.  To make this
| occur,
|  (a) the programmer must register the root of the tree with a
|      function to break up the tree, which will be invoked later
|      automatically by the garbage collector, or
|
|  (b) the programmer must register the root of the tree, and at
|      certain point of the program she/he must explicitly invoke
|      a function which retrieves the trees unreachable except
|      from the `registration' server and breaks them up.
|
|  (In any case, unreachable trees that contain no `registered'
|   objects will be recycled with no invocations of __del__.)

I want to ask more about this, partly I'm not sure I understand what
the trees and their roots are or what registration would require.

Could something like a standard class method accomplish this?  Like,

   def __garbagecollected__(self):
       # author knows self.parent is a circular reference.
       self.parent = None

   def __del__(self):
       if self.parent:
           ...


	Donn Cave, University Computing Services, University of Washington
	donn at u.washington.edu




More information about the Python-list mailing list