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=1.7 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, INFO_TLD,SPF_NEUTRAL 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 3BDF8BC68 for ; Tue, 26 Sep 2006 16:37:32 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.231]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8QEbVFN023333 for ; Tue, 26 Sep 2006 16:37:31 +0200 Received: by wx-out-0506.google.com with SMTP id s7so2261923wxc for ; Tue, 26 Sep 2006 07:37:29 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=E+X2CzUDyKA2dYOUeN0OTGg3SYME5IpR1ubuq/Zrd880/W5kRMzXqvWVWVWyAPV0l+ijgFPkK174UB8JHKNN+HNjVcg9e7f8EPbMn3HU4J4+9IQ9xtrn3+IDA0mmcmFy6AkC7+jUXHO9UJjiwsN7UYjFVdXTw0/H3sCrVBDURwc= Received: by 10.70.23.2 with SMTP id 2mr860776wxw; Tue, 26 Sep 2006 07:37:28 -0700 (PDT) Received: by 10.70.16.10 with HTTP; Tue, 26 Sep 2006 07:37:27 -0700 (PDT) Message-ID: Date: Tue, 26 Sep 2006 10:37:27 -0400 From: "Markus Mottl" To: "Damien Doligez" Subject: Re: [Caml-list] Regarding SMP computing Cc: "caml users" , quant@janestcapital.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4517C7FE.8080102@mcmaster.ca> <20060925194153.GA20467@furbychan.cocan.org> X-j-chkmail-Score: MSGID : 45193B2B.000 on discorde : j-chkmail score : X : 0/20 1 X-Miltered: at discorde with ID 45193B2B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; markus:01 mottl:01 markus:01 mottl:01 damien:01 damien:01 ocaml:01 rework:01 runtime:01 pointers:01 ocaml-heap:01 pointers:01 ocaml-heap:01 pointer:01 ocaml-value:01 On 9/26/06, Damien Doligez wrote: > The GC doesn't work by checking whether something has become > unreachable. It works by marking all reachable data, then deallocating > everything else. There is no way to do what you want in OCaml, and > I don't think it can be done without a major rework of the runtime > system. But isn't it true that the GC doesn't follow pointers that point outside the OCaml-heap? In that case it might be conceivable to copy OCaml-data that must not be reclaimed into the C-heap. Of course, this would mean that pointers must not point back into the OCaml-heap from there, because there is no way the GC could know then that some value in the OCaml-heap is still in use, or how to update the pointer in the C-heap in case the OCaml-value gets moved around, e.g. during a compaction. If the above really works, I'd be glad to know whether there is already functionality to copy OCaml-structures around. We have some applications that would greatly benefit from this feature, too: they require an enormous amount of static background knowledge, and have to use it for small jobs which can be easily distributed. We have multi-core, multi-processor machines, and would be able to greatly speed up our compute jobs if we could put these large OCaml-values into a shared-memory region. It would save us both a hell lot of memory (probably in the range of GBs per machine for some jobs), and also make the GC work less hard marking data that is not going to be reclaimed anyway. Regards, Markus -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com