Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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?

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