Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Stopping a value from getting GC'd
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nathaniel Gray <n8gray@g...>
Subject: Cost of register_global_root (was: Stopping a value from getting GC'd)
On 8/16/05, Bardur Arantsson <spam@scientician.net> 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?
> >
> 
> 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

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->