From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA24015; Fri, 9 Aug 2002 11:31:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA24146 for caml-list@pauillac.inria.fr; Fri, 9 Aug 2002 11:31:11 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA30216 for ; Thu, 8 Aug 2002 16:09:08 +0200 (MET DST) Received: from jhuml3.jhu.edu (jhuml3.jhu.edu [128.220.2.66]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g78E97j18083 for ; Thu, 8 Aug 2002 16:09:07 +0200 (MET DST) Received: from jhuml3.jhu.edu (jhuml3.jhu.edu [128.220.2.66]) by jhuml3.jhu.edu (PMDF V6.1 #47562) with SMTP id <0H0J004ZM3B5EK@jhuml3.jhu.edu> for caml-list@inria.fr; Thu, 08 Aug 2002 10:09:05 -0400 (EDT) Received: from jhuml3.jhu.edu ([128.220.2.66]) by jhuml3.jhu.edu (NAVGW 2.5.1.18) with SMTP id M2002080810090520235 for ; Thu, 08 Aug 2002 10:09:05 -0400 Received: from goedel.cog.jhu.edu (goedel.cog.jhu.edu [128.220.29.8]) by jhuml3.jhu.edu (PMDF V6.1 #47562) with ESMTP id <0H0J004ZH3B5EK@jhuml3.jhu.edu> for caml-list@inria.fr; Thu, 08 Aug 2002 10:09:05 -0400 (EDT) Date: Thu, 08 Aug 2002 10:09:11 -0400 From: John Hale Subject: [Caml-list] finalisers, Weak pointers To: caml-list@inria.fr Message-id: <6967B720-AAD8-11D6-A657-00039311FF84@jhu.edu> MIME-version: 1.0 (Apple Message framework v482) X-Mailer: Apple Mail (2.482) Content-type: text/plain; charset=US-ASCII; format=flowed Content-transfer-encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, does there exist any way to ensure that finalisers registered via the (undocumented) Gc.finalise are called in order of their registration? I have a program that deals in data structures that are collectively too big to all fit in main memory at once, and so I'd like to allow the garbage collector to decide when to write them out to disk files by (1) storing them in an array of Weak pointers and (2) attaching finalisers who linearize the contents of array cells using the Marshal module. as Damien Doligez writes in the stdlib/gc.mli, > A number of pitfalls are associated with finalised values: > finalisation functions are called asynchronously, sometimes > even during the execution of other finalisation functions. (cf. http://caml.inria.fr/archives/200001/msg00011.html) what I'm finding is that the finalisers sometimes get called in wacky orders such that `older' occupants of the Weak array overwrite (on disk) what should be the current occupants. Is this just the "asynchronous" nature of the finalisers? Is there any way to implement this kind of weak-pointer, disk-based backing store without having to "write-through" each time? In my particular case the data structures are variable-length so it seems only right that it be the Gc's decision whether they are too big to keep in-core. thanks, -john ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners