From luke@nokomis.stat.umn.edu  Wed Apr 11 15:14:53 2001
From: luke@nokomis.stat.umn.edu (Luke Tierney)
Date: Wed, 11 Apr 2001 09:14:53 -0500
Subject: [Rd] a couple of ideas/proposals
In-Reply-To: <20010411092927.D23203@jimmy.harvard.edu>; from rgentlem@jimmy.harvard.edu on Wed, Apr 11, 2001 at 09:29:27AM -0400
References: <20010411092927.D23203@jimmy.harvard.edu>
Message-ID: <20010411091453.A18327@nokomis.stat.umn.edu>

On Wed, Apr 11, 2001 at 09:29:27AM -0400, Robert Gentleman wrote:
>     Another thing that Byron mentioned is that he is using finalizers
>     quite a lot but that R doesn't do a gc on exit and so these don't
>     always get called (I haven't checked) but I think that might
>     become necessary.

I think what is needed here is a more flexible exit handler mechanism
together with weak references (which I'm hoping to add before too long).

For exit handling right now I think all we have is .Last.  It would be
nice to have something more like the
Tcl_CreateExitHandler/Tcl_DeleteExitHandler mechanism, together with
an appropriate R interface.

Without knowing the details I can't be sure, but I suspect he doesn't
really want a gc, which would only run the finalizers for unreachable
objects (actually might run is a better since there are no guarantees
of timeliness with finalization).  Instead I suspect he would like a
means of making sure all external objects he uses are shut down, even
the reachable ones.  To do that would require keeping track if all
those objects in a way that doesn't prevent GC (i.e. with weak
references) and then running through those externals and shutting them
down in an exit handler routine.

luke

-- 
Luke Tierney
University of Minnesota                      Phone:           612-625-7843
School of Statistics                         Fax:             612-624-8868
313 Ford Hall, 224 Church St. S.E.           email:      luke@stat.umn.edu
Minneapolis, MN 55455 USA                    WWW:  http://www.stat.umn.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] a couple of ideas/proposals
Luke Tierney