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.8 required=5.0 tests=AWL 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 B304BBC0C for ; Sat, 2 Dec 2006 00:28:44 +0100 (CET) Received: from 30.mail-out.ovh.net (30.mail-out.ovh.net [213.186.62.213]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id kB1NSiMV001834 for ; Sat, 2 Dec 2006 00:28:44 +0100 Received: (qmail 8259 invoked by uid 503); 1 Dec 2006 23:28:55 -0000 Received: (QMFILT: 1.0); 01 Dec 2006 23:28:55 -0000 Received: from b6.ovh.net (HELO mail183.ha.ovh.net) (213.186.33.56) by 30.mail-out.ovh.net with SMTP; 1 Dec 2006 23:28:55 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 1 Dec 2006 23:28:16 -0000 Received: from vil93-4-82-227-140-227.fbx.proxad.net (HELO ?192.168.1.201?) (lists%philippewang.info@82.227.140.227) by ns0.ovh.net with SMTP; 1 Dec 2006 23:28:15 -0000 Message-ID: <4570BAA1.2090300@philippewang.info> Date: Sat, 02 Dec 2006 00:28:33 +0100 From: Philippe Wang User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: Dmitry Bely Cc: caml-list@inria.fr 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> <90823c940612010539vacb2ffasf4e90748ef1c0485@mail.gmail.com> In-Reply-To: <90823c940612010539vacb2ffasf4e90748ef1c0485@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Ovh-Remote: 82.227.140.227 (vil93-4-82-227-140-227.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Miltered: at discorde with ID 4570BAAC.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 threads:01 ocaml:01 threads:01 heap:01 heap:01 garbage:01 wrote:01 minor:01 caml-list:01 dmitry:01 dmitry:01 bely:01 bely:01 module:03 Hi. You can't try to use the thread system to do something like that. There is a global mutex with OCaml threads ! So a program written in OCaml will not be faster by using threads... And guess what ? The global mutex does exist because of the existence of the GC. And the GC is not threaded... Well, if ever you manage to do what you said, please let me know. (If I have well understood your plan, it's clearly impossible) -- Philippe Wang Dmitry Bely a écrit : > On 12/1/06, Richard Jones wrote: > >> I've only seen two cases where I'd want to stop the GC from running: >> (1) During quasi real-time operations (eg. a single frame in a game) -- >> this can be solved by making the heap large enough and running the GC >> at scheduled points. (2) When the heap is larger than physical RAM -- >> this is solved using our 'Ancient' module. > > I have a main program in C that periodically calls an OCaml function > and expects the (near) real time response. So I'd like to avoid gc > inside that function. My current plan is to have another OCaml thread > that is unfrozen just before returning results to C and does the minor > (or major - how to decide which one?) garbage collection. Will it > work? > > - Dmitry Bely