From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 7F138BC0B for ; Mon, 4 Dec 2006 10:37:49 +0100 (CET) Received: from smeltpunt.science.ru.nl (smeltpunt.science.ru.nl [131.174.16.145]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kB49bmMj001830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 4 Dec 2006 10:37:49 +0100 Received: from tandem.cs.ru.nl [131.174.142.18] (helo=tandem.cs.ru.nl) by smeltpunt.science.ru.nl (8.13.7/5.10) with ESMTP id kB49bmAL007314; Mon, 4 Dec 2006 10:37:48 +0100 (MET) Received: from tews by tandem.cs.ru.nl with local (Exim 4.63) (envelope-from ) id 1GrAGi-0004f6-7O; Mon, 04 Dec 2006 10:37:48 +0100 From: Hendrik Tews To: "Neal Wang" Cc: "The Caml Trade" Subject: Re: [Caml-list] Can GC be BLOCKed? References: <1965df800611291633q4f615df5qaa43dc967ba87d56@mail.gmail.com> <1FB91514-18D1-4502-AF67-C1003EB8636B@mac.com> <1965df800611301607g330f5517saeba25d40c3321ca@mail.gmail.com> <20061201091932.GA29517@furbychan.cocan.org> <1965df800612011053x1c442d31if3ef14c5f87ba76d@mail.gmail.com> Date: Mon, 04 Dec 2006 10:37:48 +0100 In-Reply-To: <1965df800612011053x1c442d31if3ef14c5f87ba76d@mail.gmail.com> (Neal Wang's message of "Fri, 1 Dec 2006 10:53:08 -0800") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.56 on 131.174.16.145 X-Miltered: at discorde with ID 4573EC6C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; hendrik:01 tews:01 tews:01 ocaml:01 statically:01 hendrik:01 heap:01 heap:01 imho:01 exception:01 exception:01 writes:01 caml-list:01 functions:01 exceptions:01 "Neal Wang" writes: The problem is not caused by real-time requirement. I would also suggest to solve you problem by postponing the write-backs using some queue either in ocaml or on the C side. However: IMHO, providing a way to disable GC will help a lot in variant situations. The only side effect of misuse such a feature is out of memory exception which does happen even GC is always enabled. I find it also an interesting idea to be able to block the GC for certain periods. However, it seems that exceptions are heap allocated, so you would have to allocate the Out_of_memory exception statically (not sure if that's possible). Further, if GC is blocked and the heap is full you can do almost nothing until the collection is completed. All functions that catch and reraise exceptions like try ... with | x -> release_the_lock(); raise x would probably not work as expected with an Out_of_memory exception. Bye, Hendrik