English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] fumbling with Gc.finalise
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-10-01 (21:08)
From: Chris Quinn <cq@h...>
Subject: [Caml-list] fumbling with Gc.finalise
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?

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