[gclist] Some thoughts on finalizer ordering

Charles Fiterman cef@geodesic.com
Tue, 17 Nov 1998 07:56:25 -0600



First I'm presupposing a cooperating system not

something layered on C++ etc.


In this case finalizer ordering is in the semantics

of the mutator and there will be syntax to express

that semantics. That is the user will be able to

express finalizer ordering.


If a buffer object uses a file object in such a way

that the buffer object must finalize first it makes

sense to say all buffer objects in a pass must go

before all file objects. That is ordering can be a

characteristic of class definitions not objects.


In many systems doing this means checks for cycles

can be done at compile time or link time. Where 

classes can be defined at run time it is obvious that 

no checks can be done at compile time but checks can 

be moved back to the point where classes are defined. 

If there is partial evaluation that can still mean

compile time.


Inheritance may make classes less restrictive not

more. Requiring later finalization is more restrictive

than allowing earlier finalization. In terms of 

restrictivness the buffer object is less restrictive

than the file object because it could have been

finalized later assuming the finalizer worked.


When objects are composed the parts must all be

finalized at the same time. If there is a confilct

the user must resolve it. The user must use notation 

for this so we know he understands the problem. The 

ideal notation is to allow the surrounding class to 

invoke the sub finalizers in its finalizer. 


Suppose you have a file_buffer object with a file

and buffer. There would be notation saying the

sub objects didn't run their own finalizers and

the file_buffer object would run those finalizers.

It would specify its own finalizer sequencing.




<color><param>8080,0000,0000</param>

Charles Fiterman		  Geodesic Systems

414 North Orleans Suite 410	  Phone 312 832 1221 x223

Chicago IL 60610-4418           FAX   312 832 1230

				  http://www.geodesic.com


</color>As the complexity of a system increases our ability to make

precise and yet significant statements about its behavior

diminishes until a threshold is reached beyond which precision

and significance or relevance become almost mutually exclusive

characteristics. -- Lofti Zadeh