English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2005-08-18 (01:31)
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?


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