From: Glenn Parker Date: 2005-04-13T07:51:04+09:00 Subject: Re: ability to run finalizers at a given point of a program? Guillaume Cottenceau wrote: > > Ok, since I know that no one will want to do that without a more > precise example, here it is: what happens when the resource is > allocated and worked on first, then in a totally different part of the > program, much later, results are extracted from it - and this > extraction can also possibly be performed multiple times, then again > later (laaaaaater) the object is collected? Does this block trick > still work? It seems not, if I understand it correctly. Fair enough, long-lived objects are not suitable for the block-wrapping trick. But that still doesn't explain the nature of the work you want to do in a finalizer. Do you know when the last "extraction" has been done (making it safe for your finalizer to run)? Can you use that knowledge to explicitly run the finalization method, instead of waiting for the GC? -- Glenn Parker | glenn.parker-AT-comcast.net |