From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 4AB3FBCA2 for ; Thu, 18 Aug 2005 03:31:16 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j7I1VF3u005224 for ; Thu, 18 Aug 2005 03:31:15 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA30642 for ; Thu, 18 Aug 2005 03:31:15 +0200 (MET DST) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j7I1VDOT005221 for ; Thu, 18 Aug 2005 03:31:14 +0200 Received: by zproxy.gmail.com with SMTP id x3so203460nzd for ; Wed, 17 Aug 2005 18:31:13 -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=pvk1b6A5vf8Fw/yS/ZteJQUthM9bc8IrkJVo3zghlM7FDLZxoL8NkVa5Q+SexQMBZQM3ncspBmmibxy0ncQKFuyrYxOfl8JKnwSrXrAk4xtzgpns595coHKLhcTQ394fg9OzHKKUHUzCJxVhv/JziV6jzxdQMjIORFbuIyYrDBA= Received: by 10.36.66.15 with SMTP id o15mr803195nza; Wed, 17 Aug 2005 18:31:13 -0700 (PDT) Received: by 10.36.17.2 with HTTP; Wed, 17 Aug 2005 18:31:13 -0700 (PDT) Message-ID: Date: Wed, 17 Aug 2005 18:31:13 -0700 From: Nathaniel Gray To: Bardur Arantsson Subject: Cost of register_global_root (was: Stopping a value from getting GC'd) Cc: caml-list@inria.fr In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Miltered: at nez-perce with ID 4303E4E3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4303E4E1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; gc'd:01 rtfm:01 cheers:01 wrote:01 wrote:01 abstract:01 caltech:02 caltech:02 thread:02 thread:02 closure:02 closure:02 root:03 root:03 referencing:07 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 On 8/16/05, Bardur Arantsson wrote: > Jonathan Roewen wrote: > > > > Now my question is, since my Thread.t is abstract, once I pass my > > value to my Thread.create, there'll soon be nothing referencing the > > closure for the thread that's visible by the GC. > > > > If I'm correct, the GC would then be allowed to reclaim this closure. > > So how do I stop the GC from doing that? > > >=20 > register_global_root (or as some others would say: RTFM). One thing that the FM doesn't mention is how expensive it is to register a global root. Can I register thousands of them or will there be performance problems? Cheers, -n8 --=20 >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->