caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] fumbling with Gc.finalise
@ 2001-10-01 21:12 Chris Quinn
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Quinn @ 2001-10-01 21:12 UTC (permalink / raw)
  To: CAML LIST, caml

Hi TeamCaml,

I've been using this function quite a bit now I've discovered it.
I thought I'd captured the dependencies between a bunch of related resource handles such as to guarantee orderly resource release. But I've just been bitten and realised that if a bunch of values are no longer reachable from the rest of the program, 
no account is taken of the pointer relationships existing between them. Thus there is no guaranteed running order of the finalisation functions.

Would it not be more reasonable to treat the argument and finalisation closure as roots until the latter has actually completed execution?

Thanks,
Chris Q.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re:  [Caml-list] fumbling with Gc.finalise
@ 2001-10-05 12:04 Damien Doligez
  0 siblings, 0 replies; 2+ messages in thread
From: Damien Doligez @ 2001-10-05 12:04 UTC (permalink / raw)
  To: caml-list, caml, cq

From: Chris Quinn <cq@htec.demon.co.uk>

>Would it not be more reasonable to treat the argument and
>finalisation closure as roots until the latter has actually completed
>execution? 

That's exactly what the current system does.  I guess what you want is
that the finalisation function for a value is not called until the
finalisation functions of all values that depend on it have finished
execution.  There are two problems with that:

1. What happens to circular values (a circular value depends on
   itself, directly or indirectly).

2. How to implement it with reasonable efficiency.  I don't have a
   solution.

-- Damien
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-10-05 12:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-01 21:12 [Caml-list] fumbling with Gc.finalise Chris Quinn
2001-10-05 12:04 Damien Doligez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).