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 KAA12600; Fri, 2 Jul 2004 10:54:03 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA12393 for ; Fri, 2 Jul 2004 10:54:02 +0200 (MET DST) Received: from tcs.inf.tu-dresden.de (tcs.inf.tu-dresden.de [141.76.75.101]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i628s1SH015040 for ; Fri, 2 Jul 2004 10:54:01 +0200 Received: from ithif51.inf.tu-dresden.de (ithif51 [141.76.75.51]) by tcs.inf.tu-dresden.de (8.12.9/8.12.9) with ESMTP id i628rxi1016192; Fri, 2 Jul 2004 10:54:00 +0200 (MET DST) Received: from tews by ithif51.inf.tu-dresden.de with local (Exim 3.36 #1 (Debian)) id 1BgJnz-0004nK-00; Fri, 02 Jul 2004 10:53:59 +0200 To: Jan Kybic Cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Re: Q: automatic forgetting cache, module Weak, Gc control References: <20040701.174358.116814367.garrigue@kurims.kyoto-u.ac.jp> <1088690342.2582.122.camel@pelican.wigram> From: Hendrik Tews Date: 02 Jul 2004 10:53:59 +0200 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) at tcs.inf.tu-dresden.de X-Miltered: at concorde with ID 40E522A9.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 hendrik:01 tews:01 tews:01 hashtable:01 fifo:01 fifo:01 apropriate:01 hendrik:01 arrays:01 tu-dresden:01 cached:01 writes:01 variant:02 module:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jan Kybic writes: I think the right idea is to insert each cached values into two structures: a weak hashtable so that the value can be found fast, and another global FIFO type structure that will start to drop oldest values when there is not enough memory. For efficiency, the FIFO structure will hold blocks (arrays). As the FIFO structure is global and will have to hold different types of data, storing Obj.t seems to be apropriate. Why don't you use a variant type? Bye, Hendrik ------------------- 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